cut scene ... working ???

This commit is contained in:
Aaron Mueller 2014-12-07 18:59:59 +01:00
parent 50322fedf5
commit 393af0b9b5
1 changed files with 28 additions and 0 deletions

View File

@ -15,6 +15,30 @@ app.game =
@hud.start()
@speechbubble.start()
@cutScene = true
@cutSceneImage = app.images.intro1
@intro = false
@startCutScene()
# TODO: Refactor this whole crap ... I can't belive I am writing rthis ...
startCutScene: ->
window.setTimeout @cutScene2, 500
cutScene2: =>
@cutSceneImage = app.images.intro2
window.setTimeout @cutScene3, 500
cutScene3: =>
@cutSceneImage = app.images.intro3
window.setTimeout @cutScene4, 500
cutScene4: =>
@cutSceneImage = app.images.intro4
window.setTimeout @cutSceneEnd, 500
cutSceneEnd: =>
@cutScene = false
@intro = true
@startIntro()
@ -41,6 +65,10 @@ app.game =
app.game.speechbubble.setMouse()
render: ->
if @cutScene
app.layer.drawImage @cutSceneImage, 0, 0, 20*8, 15*8
return
if @gameEndCheck()
app.layer.drawImage app.images.end, 0, 0, 20*8, 15*8
return