@@ -39,6 +39,7 @@ var endGamePullEndTween;
39
39
var endGameCurrentScoreText ;
40
40
var endGameCurrentBestScoreText ;
41
41
var canClick = true ;
42
+ var scoreBoardButton ;
42
43
43
44
var startInfoText ;
44
45
@@ -56,6 +57,7 @@ function preload() {
56
57
game . load . image ( 'click' , 'click_flat.png' ) ;
57
58
game . load . image ( 'logo' , 'logo.png' ) ;
58
59
game . load . image ( 'endgame' , 'endgame.png' ) ;
60
+ game . load . image ( 'sumbit' , 'submit.png' ) ;
59
61
game . load . audio ( 's_wall' , [ 'wall.mp3' , 'wall.ogg' ] ) ;
60
62
game . load . audio ( 's_gate' , [ 'gate.mp3' , 'gate.ogg' ] ) ;
61
63
game . load . audio ( 's_jump' , [ 'jump.mp3' , 'jump.ogg' ] ) ;
@@ -105,8 +107,6 @@ function create() {
105
107
//walls
106
108
gateGroup = game . add . group ( ) ;
107
109
108
-
109
-
110
110
// marvin
111
111
marvin = game . add . sprite ( 0 , 0 , "marvin_gfx" ) ;
112
112
marvin . anchor . setTo ( 0.5 , 0.5 ) ;
@@ -132,18 +132,18 @@ function create() {
132
132
startInfoText . x = game . width / 2 ;
133
133
startInfoText . y = game . height / 2 ;
134
134
135
- var title_logo = game . add . sprite ( gaps / 2 + 45 , gaps / 2 , "logo" ) ;
135
+ var title_logo = game . add . sprite ( gaps / 2 + 30 , gaps / 2 , "logo" ) ;
136
136
title_logo . anchor . setTo ( 0.5 , 0.5 ) ;
137
137
138
138
var titleStyle = { font : "24px Arial" , fill : "#686B7A" , align : "left" } ;
139
- var title_text = game . add . text ( 100 + 45 , gaps / 2 , "FLAPPY BIDS" , titleStyle ) ;
139
+ var title_text = game . add . text ( 100 + 10 , gaps / 2 , "FLAPPY BIDS" , titleStyle ) ;
140
140
title_text . anchor . setTo ( 0 , 0.5 ) ;
141
141
142
- var scoreCounterStyle = { font : "42px Arial" , fill : "#00CFB5" , align : "center" } ;
142
+ var scoreCounterStyle = { font : "27px Arial" , fill : "#00CFB5" , align : "center" } ;
143
143
scoreCounter = game . add . text ( 100 + 45 , gaps / 2 , "0" , scoreCounterStyle ) ;
144
144
scoreCounter . x = game . width / 2 ;
145
145
scoreCounter . anchor . setTo ( 0.5 , 0.5 ) ;
146
- scoreCounter . y = 150 ;
146
+ scoreCounter . y = 130 ;
147
147
148
148
endGameBannerGroup = game . add . group ( ) ;
149
149
//endGameBannerGroup.anchor.setTo(0.5,0.5);
@@ -154,18 +154,25 @@ function create() {
154
154
endGameBannerGroup . add ( endGameBanner ) ;
155
155
156
156
var endGameScoreTextStyle = { font : "18px Arial" , fill : "#00CFB5" , align : "center" } ;
157
- endGameCurrentScoreText = game . add . text ( 0 , 0 , "Current bid : $0.0" , endGameScoreTextStyle ) ;
158
- endGameCurrentBestScoreText = game . add . text ( 0 , 25 , "Highest bid : $0.0" , endGameScoreTextStyle ) ;
157
+ endGameCurrentScoreText = game . add . text ( 0 , - 30 , "Current: $0.0" , endGameScoreTextStyle ) ;
158
+ endGameCurrentBestScoreText = game . add . text ( 0 , - 5 , "Highest: $0.0" , endGameScoreTextStyle ) ;
159
159
endGameCurrentScoreText . anchor . setTo ( 0.5 , 0.5 ) ;
160
160
endGameCurrentBestScoreText . anchor . setTo ( 0.5 , 0.5 ) ;
161
161
endGameBannerGroup . add ( endGameCurrentScoreText ) ;
162
162
endGameBannerGroup . add ( endGameCurrentBestScoreText ) ;
163
163
164
+ scoreBoardButton = game . add . button ( 0 , 35 , 'sumbit' , onClickScoreboard , this , 0 , 0 , 0 ) ;
165
+ scoreBoardButton . anchor . setTo ( 0.5 , 0.5 ) ;
166
+ endGameBannerGroup . add ( scoreBoardButton ) ;
164
167
165
168
resetGame ( ) ;
166
169
167
170
}
168
171
172
+ function onClickScoreboard ( ) {
173
+ window . location . href = "/scoreboard.html?s=" + scoreStringFromScore ( score ) ;
174
+ }
175
+
169
176
function generateWalls ( ) {
170
177
171
178
var oldPairs = gatePairs ;
@@ -250,14 +257,17 @@ function setScore(_score){
250
257
}
251
258
252
259
scoreCounter . setText ( scoreStringFromScore ( score ) ) ;
253
- endGameCurrentScoreText . setText ( "Current bid: " + scoreStringFromScore ( score ) ) ;
254
- endGameCurrentBestScoreText . setText ( "Highest bid: " + scoreStringFromScore ( bestScore ) ) ;
260
+ endGameCurrentScoreText . setText ( "Current " + scoreStringFromScore ( score ) ) ;
261
+ endGameCurrentBestScoreText . setText ( "Highest " + scoreStringFromScore ( bestScore ) ) ;
255
262
}
256
263
257
264
function scoreStringFromScore ( _score ) {
258
265
266
+ //var s = _score+"%";
267
+ //return s;
268
+
259
269
var s = _score / 10 ;
260
- return "$ " + s + ( s % 1 == 0 ?".0" :"" ) ;
270
+ return "ROI: " + s + ( s % 1 == 0 ?".0" :"" ) + "x" ;
261
271
}
262
272
263
273
function resetMarvin ( ) {
0 commit comments