Skip to content

Commit

Permalink
pass satisfaction to upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
leafo committed Aug 25, 2013
1 parent 24b652d commit 5b09a59
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 0 additions & 1 deletion feed.moon
Expand Up @@ -187,7 +187,6 @@ class Head

delta = math.abs 0.5 - random_normal!
to_hide = math.floor delta / 0.09
to_hide = 3

while to_hide > 0
not_hungry = pick_one unpack [k for k,v in pairs @hungry_for when v]
Expand Down
6 changes: 4 additions & 2 deletions main.moon
@@ -1,7 +1,7 @@
require "lovekit.all"
require "lovekit.reloader"

{graphics: g} = love
{graphics: g, :keyboard} = love

export p = (str, ...) ->
g.print str\lower!, ...
Expand Down Expand Up @@ -46,7 +46,7 @@ class Game
}

@sequence = Sequence ->
@current_stage = @stages[@stage_i] @
@current_stage = @stages[@stage_i] @, @current_stage
wait_until -> @current_stage\is_done!
@stage_i = (@stage_i % #@stages) + 1
again!
Expand All @@ -55,6 +55,8 @@ class Game

update: (dt) =>
return if @paused
dt = dt * 10 if keyboard.isDown "return"

@sequence\update dt

if @current_stage
Expand Down
10 changes: 6 additions & 4 deletions upgrade.moon
Expand Up @@ -91,8 +91,8 @@ class UpgradeStage extends Stage
name: "Upgrade Stage"
money_earned: 0

new: (...) =>
super ...
new: (game, feed) =>
super game

u = (name) ->
key = name\sub 1, 1
Expand All @@ -111,8 +111,10 @@ class UpgradeStage extends Stage
u "organization"
}

satisfation = 1.0

satisfation = if feed
feed.head.health
else
1.0

@health = HorizBar 110, 6, satisfation
@health.tween_speed = 0.15
Expand Down

0 comments on commit 5b09a59

Please sign in to comment.