Skip to content

Commit

Permalink
change hud in zombie mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Urbas committed Nov 29, 2013
1 parent 764a8d3 commit e63df4d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
16 changes: 14 additions & 2 deletions app/scripts/game.js

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

4 changes: 2 additions & 2 deletions app/scripts/game/scenes/hud.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Q.scene "hud", (stage) ->
# stage.insert new Q.UI.RadialGradient()

# doctor's comments
playerAvatar = stage.insert new Q.UI.PlayerAvatar()
Game.playerAvatar = playerAvatar = stage.insert new Q.UI.PlayerAvatar()

infoContainer = stage.insert new Q.UI.Container
y: 40
Expand Down Expand Up @@ -43,7 +43,7 @@ Q.scene "hud", (stage) ->
y: 40
fill: "#232322"

healthImg = healthContainer.insert new Q.UI.HealthImg()
Game.healthImg = healthImg = healthContainer.insert new Q.UI.HealthImg()
healthContainer.insert new Q.UI.HealthCounter
img: healthImg.p

Expand Down
3 changes: 3 additions & 0 deletions app/scripts/game/sprites/characters/zombie_player.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Q.Sprite.extend "ZombiePlayer",

Game.infoLabel.zombieModeOnNext()
Game.currentLevelData.zombieModeFound = true
Game.playerAvatar.changeToZombie()
Game.healthImg.changeToHalf()

# audio
Q.AudioManager.remove Game.audio.playerBg
Expand Down Expand Up @@ -96,6 +98,7 @@ Q.Sprite.extend "ZombiePlayer",
Game.setCameraTo(@stage, player)

Game.infoLabel.zombieModeOff()
Game.playerAvatar.changeToPlayer()

Q.AudioManager.remove Game.audio.zombieMode
@destroy()
3 changes: 3 additions & 0 deletions app/scripts/game/sprites/hud/health_img.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ Q.UI.HealthImg = Q.Sprite.extend "Q.UI.HealthImg",
x: 0
y: 0
sheet: "hud_health"

changeToHalf: ->
@p.sheet = "hud_health_half"
6 changes: 6 additions & 0 deletions app/scripts/game/sprites/hud/player_avatar.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ Q.UI.PlayerAvatar = Q.Sprite.extend "Q.UI.PlayerAvatar",
@p.x = @p.w/2
@p.y = @p.h/2

changeToZombie: ->
@p.sheet = "hud_zombie_player"

changeToPlayer: ->
@p.sheet = "hud_player"

0 comments on commit e63df4d

Please sign in to comment.