Browse Source

flyEnd animation;

bjorn 10 years ago
parent
commit
7a15a66852
2 changed files with 8 additions and 0 deletions
  1. 4 0
      data/animation/pigeon.lua
  2. 4 0
      pigeon.lua

+ 4 - 0
data/animation/pigeon.lua

@@ -27,6 +27,10 @@ Pigeon.states.jump = {
 }
 
 Pigeon.states.fly = {
+  loop = true
+}
+
+Pigeon.states.flyEnd = {
   loop = false
 }
 

+ 4 - 0
pigeon.lua

@@ -433,6 +433,10 @@ function Pigeon.air:update()
     end
   end
 
+  if self.animation.state.name == 'fly' and (not love.keyboard.isDown(' ') or self.fuel < 1) then
+    self.animation:set('flyEnd')
+  end
+
   self.air.lastVelocity = vy
 end