Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run('gameapi')
- player = actor:new(1,10,'O')
- --basic player movement
- function game.key(k)
- if k==203 then --left
- player:addX(-1)
- player:setChar('<')
- elseif k==205 then --right
- player:addX(1)
- player:setChar('>')
- elseif k==200 then --up
- player:addY(-1)
- player:setChar('^')
- elseif k==208 then --down
- player:addY(1)
- player:setChar('V')
- end
- end
- function game.update()
- print "you could print the player's score here"
- end
- game.start() --NEEDED
Advertisement
Add Comment
Please, Sign In to add comment