Skip to content

Commit

Permalink
zombie player changes humans to zombies too
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Urbas committed Nov 29, 2013
1 parent d44b8e6 commit 5a3fb40
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
12 changes: 9 additions & 3 deletions app/scripts/game.js

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

7 changes: 6 additions & 1 deletion app/scripts/game/sprites/characters/human.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ Q.Sprite.extend "Human",
obj.play("attack", 10)
@play("outro")

if obj.isA("ZombiePlayer")
@play("outro")
@p.zombiePlayerSensor = true

die: ->
@destroy()

Expand All @@ -61,4 +65,5 @@ Q.Sprite.extend "Human",
y: @p.y
startLeft: randomBool

zombie.p.wasHuman = true
if !@p.zombiePlayerSensor
zombie.p.wasHuman = true
2 changes: 1 addition & 1 deletion app/scripts/game/sprites/characters/zombie_player.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Q.Sprite.extend "ZombiePlayer",
sheet: "zombie_player"
sprite: "zombiePlayer"
type: Game.SPRITE_ZOMBIE_PLAYER
collisionMask: Game.SPRITE_TILES | Game.SPRITE_PLAYER_COLLECTIBLE
collisionMask: Game.SPRITE_TILES | Game.SPRITE_HUMAN

@add("2d, platformerControls, animation")

Expand Down

0 comments on commit 5a3fb40

Please sign in to comment.