Hexadecimal colors, particle data, cleaned a bit of entities, added player dash animation particles

This commit is contained in:
lustlion
2022-01-20 00:53:59 +01:00
parent d96d5dd56d
commit ccc059f40d
15 changed files with 149 additions and 456 deletions

View File

@@ -122,7 +122,19 @@ function Player:DoPhysics()
self.isOnGround = false
self.dashTimer = self.dashTimer - current_dt
-- DASH STATE
if self.dashTimer > 0 then
local particle_data = {
animation = self.body,
sprite_tint = HEX2RGB("#fed100"),
sprite_flip = {
x = self.sprite_flip.x,
y = self.sprite_flip.y
}
}
Particle:New(self.pos.x,self.pos.y,particle_data)
self.dashCooldownTimer = self.dashCooldownTime
self.vel.x = self.dashSpeed * math.cos(self.dashDirection)
self.vel.y = self.dashSpeed * math.sin(self.dashDirection)
@@ -149,11 +161,6 @@ function Player:DoPhysics()
end
function Player:HandleAnimation()
if self.dashTimer > 0 then
self.sprite_tint = {1,1,0}
else
self.sprite_tint = {1,1,1}
end
-- flip sprite to look in the direction is moving
if self.move_x ~= 0 then self.sprite_flip.x = math.sign(self.move_x) end