diff options
| author | cursed22bc <admin@pixeldawn.org> | 2026-03-10 18:46:03 +0200 |
|---|---|---|
| committer | cursed22bc <admin@pixeldawn.org> | 2026-03-10 18:46:03 +0200 |
| commit | db9454cb632a3ba0b39018513b0d5bd444c8ffd3 (patch) | |
| tree | 4cb8207977581e4a5a23b6e06c52c15caafc1448 /player.lua | |
| parent | ced650f59454d1d69a0a9cc0979e1925bd806021 (diff) | |
new player animations
Diffstat (limited to 'player.lua')
| -rw-r--r-- | player.lua | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -27,11 +27,12 @@ function Player.new(world, spawnX, spawnY) self.jumpsUsed = 0 self.animations = { idle = Animation.new("assets/player/idle.png", 16, 16, 0.6), - running = Animation.new("assets/player/running.png", 16, 16, 0.9), + running = Animation.new("assets/player/running.png", 16, 16, 0.4), going_up = Animation.new("assets/player/going_up.png", 16, 16, 0.8), going_down = Animation.new("assets/player/going_down.png", 16, 16, 0.5), - stop_running = Animation.new("assets/player/stop_running.png", 16, 16, 0.3), - ground_hit = Animation.new("assets/player/ground_hit.png", 16, 16, 0.3) + stop_running = Animation.new("assets/player/stop_running.png", 16, 16, 0.5), + ground_hit = Animation.new("assets/player/ground_hit.png", 16, 16, 0.5), + swimming = Animation.new("assets/player/swimming.png", 16, 16, 0.5) } if love and love.filesystem and love.filesystem.getDirectoryItems then local ok, items = pcall(love.filesystem.getDirectoryItems, "assets/player") @@ -139,6 +140,7 @@ function Player:update(dt) moveY = moveY / inputLen end + if move ~= 0 then self.lastFacing = move end self.body:applyForce(move * SWIM_SPEED, moveY * SWIM_SPEED) elseif onFloor or onWaterSurface then self.body:setLinearDamping(0) @@ -191,7 +193,7 @@ function Player:update(dt) running = self.animations.running, jumping = self.animations.going_up, falling = self.animations.going_down, - swimming = self.animations.going_down, + swimming = self.animations.swimming, stop_running = self.animations.stop_running, ground_hit = self.animations.ground_hit, } |
