@@ -3,6 +3,9 @@ import { HEIGHT, TEXT_FONT, theme, WIDTH } from "../constants";
33import { container } from "../util" ;
44import GameNode from "./GameNode" ;
55import ministryLogoPath from "../assets/img/ministry-logo.png" ;
6+ import imaginaryLogoPath from "../assets/img/imaginary-logo.png" ;
7+ import mpiLogoPath from "../assets/img/mpi-logo.png" ;
8+ import { inputs } from "../inputs" ;
69
710export default class Credits extends GameNode {
811 onFinish ?: ( ) => void ;
@@ -21,10 +24,20 @@ export default class Credits extends GameNode {
2124 - boxWidth / 2 ,
2225 - boxHeight / 2 ,
2326 boxWidth ,
24- boxHeight
27+ boxHeight - 350
2528 )
2629 )
2730 ) ;
31+ this . view . addChild (
32+ container (
33+ new Graphics ( ) . roundRect (
34+ - boxWidth / 2 ,
35+ boxHeight / 2 - 350 ,
36+ boxWidth ,
37+ 350
38+ )
39+ ) . fill ( "white" )
40+ ) ;
2841 const titleText = new HTMLText ( {
2942 text : "Credits" ,
3043 style : {
@@ -107,20 +120,27 @@ export default class Credits extends GameNode {
107120 }
108121 }
109122
110- handleKeyDown = ( ) => {
111- document . removeEventListener ( "keydown" , this . handleKeyDown ) ;
112- this . onFinish ?.( ) ;
123+ handleKeyDown = ( e : KeyboardEvent ) => {
124+ if (
125+ [
126+ ...Object . values ( inputs . player1 ) ,
127+ ...Object . values ( inputs . player2 ) ,
128+ ] . includes ( e . key )
129+ ) {
130+ document . removeEventListener ( "keydown" , this . handleKeyDown ) ;
131+ this . onFinish ?.( ) ;
132+ }
113133 } ;
114134
115135 async load ( ) {
116136 const fundedBy = new Container ( ) ;
117- fundedBy . position = { x : - WIDTH * 0.2 , y : HEIGHT * 0.2 } ;
137+ fundedBy . position = { x : - WIDTH * 0.3 , y : HEIGHT * 0.2 } ;
118138 const ministryLogoTexture = await Assets . load ( ministryLogoPath ) ;
119139 const titleText = new HTMLText ( {
120140 text : "Funded by" ,
121141 style : {
122142 align : "center" ,
123- fill : theme . colors . primary ,
143+ fill : "black" ,
124144 fontFamily : TEXT_FONT ,
125145 fontWeight : "bold" ,
126146 fontSize : 40 ,
@@ -134,5 +154,33 @@ export default class Credits extends GameNode {
134154 sprite . scale = 0.3 ;
135155 fundedBy . addChild ( sprite ) ;
136156 this . view . addChild ( fundedBy ) ;
157+
158+ const partOf = new Container ( ) ;
159+ partOf . position = { x : WIDTH * 0.1 , y : HEIGHT * 0.2 } ;
160+ const imaginaryLogoTexture = await Assets . load ( imaginaryLogoPath ) ;
161+ const mpiLogoTexture = await Assets . load ( mpiLogoPath ) ;
162+ const titleText2 = new HTMLText ( {
163+ text : "Part of Quantum Arcade by" ,
164+ style : {
165+ align : "center" ,
166+ fill : "black" ,
167+ fontFamily : TEXT_FONT ,
168+ fontWeight : "bold" ,
169+ fontSize : 40 ,
170+ } ,
171+ } ) ;
172+ titleText2 . anchor = { x : 0.5 , y : 0 } ;
173+ partOf . addChild ( titleText2 ) ;
174+ const sprite1 = new Sprite ( imaginaryLogoTexture ) ;
175+ sprite1 . anchor = { x : 0.5 , y : 0 } ;
176+ sprite1 . position = { x : - 300 , y : 100 } ;
177+ sprite1 . scale = 0.5 ;
178+ const sprite2 = new Sprite ( mpiLogoTexture ) ;
179+ sprite2 . anchor = { x : 0.5 , y : 0 } ;
180+ sprite2 . position = { x : 300 , y : 50 } ;
181+ sprite2 . scale = 0.5 ;
182+ partOf . addChild ( sprite1 ) ;
183+ partOf . addChild ( sprite2 ) ;
184+ this . view . addChild ( partOf ) ;
137185 }
138186}
0 commit comments