Code: Select all
PlayerAni1 = love.graphics.newImage("assets/player/player_1.png")
PlayerAni2 = love.graphics.newImage("assets/player/player_2.png")
Code: Select all
Player_CurrentAnimationTile = nil
AnimationState_Player = 0
AnimationState_Player goes from 0 to 1 using the following code.
Code: Select all
if AnimationState_Player == 0 then
AnimationState_Player = AnimationState_Player + dt
else
AnimationState_Player = 0
end
if AnimationState_Player == 0 then Player_CurrentAnimationTile = PlayerAni1 else Player_CurrentAnimationTile = PlayerAni2 end
Code: Select all
love.graphics.draw(Player_CurrentAnimationTile, PlayerPosition_X, PlayerPosition_Y)