浏览代码

Try rainbowshit;

bjorn 10 年之前
父节点
当前提交
4ddf26507c
共有 2 个文件被更改,包括 6 次插入3 次删除
  1. 1 1
      hud.lua
  2. 5 2
      pigeon.lua

+ 1 - 1
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) / 100
+  local prc = math.lerp(self.prevRainbowShitDisplay, self.rainbowShitDisplay, ls.accum / ls.tickrate) / 30
   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

+ 5 - 2
pigeon.lua

@@ -108,8 +108,10 @@ function Pigeon:update()
   f.exe(self.state.update, self)
   f.exe(self.state.update, self)
   self:contain()
   self:contain()
 
 
-  self.animation.speed = self.rainbowShitTimer > 0 and 2 or 1
-  self.rainbowShitTimer = timer.rot(self.rainbowShitTimer)
+  --self.animation.scale = self.rainbowShitTimer > 0 and 1 or .7
+  self.rainbowShitTimer = timer.rot(self.rainbowShitTimer, function()
+    flux.to(self.animation, .2, {scale = .7}, 'elasticout')
+  end)
 
 
   if love.keyboard.isDown('down') then
   if love.keyboard.isDown('down') then
     self.downDirty = timer.rot(self.downDirty)
     self.downDirty = timer.rot(self.downDirty)
@@ -341,6 +343,7 @@ end
 
 
 function Pigeon:activateRainbowShit()
 function Pigeon:activateRainbowShit()
   self.rainbowShitTimer = self.rainbowShitTimer + 5
   self.rainbowShitTimer = self.rainbowShitTimer + 5
+  flux.to(self.animation, .2, {scale = 1}, 'elasticout')
 end
 end
 
 
 ----------------
 ----------------