bugfix and slide animation
- bugfix for hook swing not taking in consideration the length of rope - bugfix for player hitbox size - bugfix for fairy flight control system FCS - added slide animation for wall slide and wall jump
This commit is contained in:
@@ -71,7 +71,7 @@ function Player:new(x,y)
|
||||
o.mask = Animation:new(animation.moth_mask.idle)
|
||||
|
||||
o:centerOffset(o.body)
|
||||
o:createBox(o.body,0,3,-1,-3)
|
||||
o:createBox(o.body,0,4,-1,-5)
|
||||
|
||||
-- lights
|
||||
o.light = Light:new(o.pos.x,o.pos.y,o.light_radius)
|
||||
@@ -131,10 +131,13 @@ function Player:doLogic()
|
||||
if self.dash_cooldown_timer == 0
|
||||
and not self.is_dashing
|
||||
and self.dash_count > 0 then
|
||||
|
||||
self:unhook()
|
||||
self.nodrift_frames = 0
|
||||
|
||||
-- state player
|
||||
self.is_dashing = true
|
||||
self.is_sliding = false
|
||||
self.dash_count = self.dash_count - 1
|
||||
|
||||
-- get dash direction
|
||||
@@ -312,9 +315,11 @@ function Player:handleAnimation()
|
||||
elseif self.move_x ~= 0 then
|
||||
self.sprite_flip.x = math.sign(self.move_x)
|
||||
end
|
||||
|
||||
-- animation priority
|
||||
if self.vel.y > 1.25 or self.is_sliding then
|
||||
if self.is_sliding then
|
||||
self.body = self.body:change(animation.nancy.slide)
|
||||
self.mask = self.mask:change(self.mask_type.slide)
|
||||
elseif self.vel.y > 1.25 then
|
||||
self.body = self.body:change(animation.nancy.fall)
|
||||
self.mask = self.mask:change(self.mask_type.fall)
|
||||
elseif self.vel.y < 0 then
|
||||
|
||||
Reference in New Issue
Block a user