Is There any way to make an Animation without Quads?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Is There any way to make an Animation without Quads?
You'll need to learn a bit more Lua, in particular how to use variables and conditions, to make stuff change over time.
Re: Is There any way to make an Animation without Quads?
Making it as simple as possible for youJacKobOriginal wrote: ↑Wed Mar 28, 2018 2:21 pmAnd how do I do that in love.update(dt)? I tried putting love.graphics.draw in it but nothing happened when I pressed the button I assigned the animation in.
Code: Select all
function love.load()
Animation1 = {}
Animation1 [1] = love.graphics.newImage("walk1.png")
Animation1[2] = love.graphics.newImage("walk2.png")
Animation1[3] = love.graphics.newImage("walk3.png")
Animation2 = {}
Animation2 [1] = love.graphics.newImage("jump1.png")
Animation2[2] = love.graphics.newImage("jump2.png")
Animation2[3] = love.graphics.newImage("jump3.png")
frame = 1
Pose = "walk"
end
function love.update()
frame = frame + 1
if frame > 3 then
frame = 1
end
If playeriswalking() then
Pose = "walk"
end
If playerisjumping() then
Pose = "jump"
end
end
function love.draw()
If Pose == "walk" then
love.graphics.draw(animation1[frame])
end
If Pose == "jump" then
love.graphics.draw(animation2[frame])
end
end
-
Who is online
Users browsing this forum: No registered users and 1 guest