Log In  


--functionsetup
playeranim = 1
timer = 0

function _init()
end

function animspr(x, y, fps, start_frame, end_frame)
    timer = timer + 1
    if timer >= 30 / fps then
        playeranim = playeranim + 1
        if playeranim > end_frame then
            playeranim = start_frame
        end
        timer = 0
    end
    spr(playeranim, x, y)
end

function _update()
end

function _draw()
    cls()
    animspr(60, 60, 4, 1, 3)
end

how this works: animspr(x, y, fps, start_frame, end_frame)




[Please log in to post a comment]