Skip to content

Commit

Permalink
fix showing end screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Urbas committed Nov 29, 2013
1 parent 1af3f76 commit 68e3f0a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
9 changes: 5 additions & 4 deletions app/scripts/game.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions app/scripts/game/init.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,7 @@ window.Game =
Game.infoLabel.intro()

stageLevelSelectScreen: ->
# last level just finished
if @Q.state.get("currentLevel") == 6
@stageEndScreen()
return

@Q.input.disableTouchControls()

@Q.clearStages()
@Q.stageScene "levelSelect"

Expand All @@ -180,6 +174,7 @@ window.Game =
@Q.stageScene "start"

stageEndScreen: ->
@Q.input.disableTouchControls()
@Q.clearStages()
@Q.stageScene "end"

Expand Down
5 changes: 5 additions & 0 deletions app/scripts/game/scenes/level_summary.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ Q.scene "levelSummary", (stage) ->
buttonNext.p.x = Q.width/2 + buttonNext.p.w/2 + 40

buttonNext.on "click", (e) ->
# last level just finished
if Q.state.get("currentLevel") == 6
Game.stageEndScreen()
return

Game.stageLevel(Q.state.get("currentLevel") + 1)

# button back
Expand Down

0 comments on commit 68e3f0a

Please sign in to comment.