Advertisement
Guest User

Untitled

a guest
Feb 16th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. px=0
  2. py=0
  3. direction=-1
  4.  
  5. function _update()
  6.     if not btn(direction) then
  7.         direction=-1
  8.     end
  9.    
  10.     for i=0,3 do
  11.         if btnp(i) and (direction==i or direction==-1) then
  12.             if i<=1 then
  13.                 px+=(i-0.5)*16
  14.             else
  15.                 py+=(i-2.5)*16
  16.             end
  17.             direction=i
  18.         end
  19.     end
  20. end
  21.  
  22. function _draw()
  23.     cls()
  24.     print("direction "..direction)
  25.     print("x "..px..", y "..py)
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement