Guest User

Untitled

a guest
Sep 5th, 2025
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. function _init()
  2.     player={
  3.         x=63,
  4.         y=63,
  5.         fx=false,
  6.         fy=true,
  7.         sp=2
  8.     }
  9. end
  10.  
  11. function _update()
  12.     --player movement--
  13.     if btn(➡️) then
  14.         player.x+=1
  15.         player.fx=false
  16.         player.sp=1
  17.     end
  18.     if btn(⬅️) then
  19.         player.x-=1
  20.         player.fx=true
  21.         player.sp=1
  22.     end
  23.     if btn(⬇️) then
  24.         player.y+=1
  25.         player.fy=true
  26.         player.sp=2
  27.     end
  28.     if btn(⬆️) then
  29.         player.y-=1
  30.         player.fy=false
  31.         player.sp=2
  32.     end
  33. end
  34.  
  35. function _draw()
  36.     cls()
  37.     spr(player.sp,player.x,player.y,1,1,player.fx,player.fy)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment