Browse Source

Growing thing;

bjorn 10 years ago
parent
commit
f1e6a9b622
2 changed files with 7 additions and 2 deletions
  1. 2 2
      hud.lua
  2. 5 0
      pigeon.lua

+ 2 - 2
hud.lua

@@ -90,7 +90,7 @@ function Hud:gui()
   local baseWidth = 20
   local baseWidth = 20
   local baseHeight = 100
   local baseHeight = 100
   g.rectangle('line', 2, 50, baseWidth, baseHeight)
   g.rectangle('line', 2, 50, baseWidth, baseHeight)
-  local prc = math.lerp(self.prevRainbowShitDisplay, self.rainbowShitDisplay, ls.accum / ls.tickrate) / 30
+  local prc = math.lerp(self.prevRainbowShitDisplay, self.rainbowShitDisplay, ls.accum / ls.tickrate) / Pigeon.rainbowShitThreshold
   g.setColor(255, 0, 0)
   g.setColor(255, 0, 0)
   g.rectangle('fill', 2, 50 + baseHeight * (1 - prc), baseWidth, baseHeight * prc)
   g.rectangle('fill', 2, 50 + baseHeight * (1 - prc), baseWidth, baseHeight * prc)
 end
 end
@@ -121,7 +121,7 @@ function Hud:addScore(amount, kind)
 
 
   if kind == 'person' then
   if kind == 'person' then
     self.rainbowShitCounter = self.rainbowShitCounter + 1
     self.rainbowShitCounter = self.rainbowShitCounter + 1
-    if self.rainbowShitCounter >= 30 then
+    if self.rainbowShitCounter >= Pigeon.rainbowShitThreshold then
       self.rainbowShitCounter = 0
       self.rainbowShitCounter = 0
       ctx.pigeon:activateRainbowShit()
       ctx.pigeon:activateRainbowShit()
     end
     end

+ 5 - 0
pigeon.lua

@@ -12,6 +12,7 @@ Pigeon.maxFlySpeed = 300
 Pigeon.maxFuel = 25
 Pigeon.maxFuel = 25
 Pigeon.laserTurnSpeed = .75
 Pigeon.laserTurnSpeed = .75
 Pigeon.laserChargeDuration = 2
 Pigeon.laserChargeDuration = 2
+Pigeon.rainbowShitThreshold = 50
 
 
 ----------------
 ----------------
 -- Core
 -- Core
@@ -123,6 +124,10 @@ function Pigeon:update()
 
 
   self:updateBeak()
   self:updateBeak()
   self:updateFeet()
   self:updateFeet()
+
+  if self.body:getX() > ctx.goal.x then
+    self:changeState('idle')
+  end
 end
 end
 
 
 function Pigeon:draw()
 function Pigeon:draw()