|
@@ -190,12 +190,16 @@ function Pigeon:update()
|
|
self:updateFeet()
|
|
self:updateFeet()
|
|
|
|
|
|
if self.body:getX() > ctx.goal.x then
|
|
if self.body:getX() > ctx.goal.x then
|
|
- self:changeState('idle')
|
|
|
|
|
|
+ if self.state ~= self.idle then
|
|
|
|
+ self:changeState('idle')
|
|
|
|
+ end
|
|
self.animation:set('flyLoop')
|
|
self.animation:set('flyLoop')
|
|
if not ctx.hud.win.active then
|
|
if not ctx.hud.win.active then
|
|
ctx.hud:activateWin()
|
|
ctx.hud:activateWin()
|
|
ctx.sound:play('win')
|
|
ctx.sound:play('win')
|
|
- ctx.backgroundSound:setVolume(.1)
|
|
|
|
|
|
+ if not ctx.sound.muted then
|
|
|
|
+ ctx.backgroundSound:setVolume(.1)
|
|
|
|
+ end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
@@ -483,20 +487,9 @@ function Pigeon.idle:update()
|
|
self:recoverFuel()
|
|
self:recoverFuel()
|
|
self.animation:set('idle')
|
|
self.animation:set('idle')
|
|
|
|
|
|
- if love.keyboard.isDown('left', 'right') then
|
|
|
|
|
|
+ if love.keyboard.isDown('return') then
|
|
return self:changeState('walk').update(self)
|
|
return self:changeState('walk').update(self)
|
|
end
|
|
end
|
|
-
|
|
|
|
- if love.keyboard.isDown('up') then
|
|
|
|
- self:changeState('air')
|
|
|
|
- elseif love.keyboard.isDown('down') then
|
|
|
|
- self:changeState('peck')
|
|
|
|
- elseif love.keyboard.isDown(' ') then
|
|
|
|
- self:changeState('laser')
|
|
|
|
- else
|
|
|
|
- local vx, vy = self.body:getLinearVelocity()
|
|
|
|
- self.body:setLinearVelocity(vx / 1.2, vy)
|
|
|
|
- end
|
|
|
|
end
|
|
end
|
|
|
|
|
|
Pigeon.walk = {}
|
|
Pigeon.walk = {}
|