Skip to content

Commit

Permalink
cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon committed Apr 1, 2012
1 parent 3a6e894 commit 7d7efbf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions game.coffee
Expand Up @@ -42,6 +42,7 @@ player_text = {red: image('player1_text.png'), blue: image('player2_text.png')}
hp_text = image 'HP.png'
hp_num = [image('1.png'), image('1.png'), image('2.png'), image('3.png')]
indicator = image 'indicator.png'
cloud = image 'cloud.png'

wiz =
img: image 'Wizard Spritesheet.png'
Expand Down Expand Up @@ -297,6 +298,8 @@ future = null
pendingActions = []
endDays = []

cloudX = 0

reset = ->
reversing = false
reversingState = 0
Expand Down Expand Up @@ -1213,6 +1216,14 @@ atom.run
ctx.drawImage hp_text, 155, 60
ctx.drawImage hp_num[hoveredUnit.hp], 240, 60


cloudSpeed = 1
cloudX += cloudSpeed * (if reversing then -1 else 1)
ctx.globalAlpha = 0.4
ctx.drawImage cloud, cloudX % canvas.width, canvas.height - cloud.height
ctx.drawImage cloud, (cloudX % canvas.width) - cloud.width, canvas.height - cloud.height
ctx.globalAlpha = 1

if reversing
reversingState = Math.min(reversingState + 0.015, 0.5)
else
Expand Down

0 comments on commit 7d7efbf

Please sign in to comment.