Log In  

Hello, i'm coding a character movement but it don't work, why ? :(

Code :

function _init()
    hero = {}
    hero.x = 64
    hero.y = 64
end

function _uptade()
    if btn(0) then 
        hero.x = hero.x - 1
    end
    if btn(1) then 
        hero.x = hero.x + 1
    end
end

function _draw()
    cls()
    spr(0,hero.x,hero.y)
end

my character don't move :(

P#22759 2016-06-12 10:51 ( Edited 2016-06-12 15:16)

your update function says "uptade" instead of "update" :)

P#22761 2016-06-12 11:00 ( Edited 2016-06-12 15:00)

Oh sorry xD thank you my bad

P#22762 2016-06-12 11:16 ( Edited 2016-06-12 15:16)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-02-01 11:38:15 | 0.006s | Q:8