particles time to be handled in frames instead of seconds optionally

This commit is contained in:
lustlion
2022-03-12 18:19:07 +01:00
parent 97de68e34b
commit 3c1746d914
2 changed files with 12 additions and 5 deletions

View File

@@ -251,7 +251,8 @@ function Player:doPhysics()
animation_speed = 0,
sprite_tint = hex2rgb("#fed100"),
sprite_alpha = 0.5,
time = 0.05,
time = 4,
time_unit = "frames",
sprite_flip = {
x = self.sprite_flip.x,
y = self.sprite_flip.y
@@ -326,10 +327,10 @@ function Player:handleAnimation()
elseif self.vel.y < 0 then
self.body = self.body:change(animation.nancy.jump)
self.mask = self.mask:change(self.mask_type.jump)
elseif self.vel.x + self.move_x ~= 0 then
elseif self.vel.x + self.move_x ~= 0 and not self.is_hooked then
self.body = self.body:change(animation.nancy.run)
self.mask = self.mask:change(self.mask_type.run)
else
elseif not self.is_hooked then
self.body = self.body:change(animation.nancy.idle)
self.mask = self.mask:change(self.mask_type.idle)
end