Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function hero.update(dt)
- if hero.y >= 0 then
- if love.keyboard.isDown("up") then
- hero.vy = 200
- hero.y = hero.y - (hero.vy*dt)
- end
- else
- hero.y = 0
- end
- if hero.x <= 556 then
- if love.keyboard.isDown("right") then
- hero.vx = 200
- hero.x = hero.x + (hero.vx*dt)
- end
- else
- hero.x = 556
- end
- if hero.y <= 559 then
- if love.keyboard.isDown("down") then
- hero.vy = 200
- hero.y = hero.y + (hero.vy*dt)
- end
- else
- hero.y = 559
- end
- if hero.x >= 0 then
- if love.keyboard.isDown("left") then
- hero.vx = 200
- hero.x = hero.x - (hero.vx*dt)
- end
- else
- hero.x = 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement