Guest User

GDE-101 - 2021.03.30 - Code

a guest
Mar 30th, 2021
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. --projet 4
  2. --by game*
  3. function _init()
  4.  p={
  5.   pv=6,
  6.   x=32,
  7.   y=32,
  8.  }
  9. end
  10.  
  11. function _update()
  12.  if btn(⬅️) then
  13.   p.x-=1
  14.  end
  15.  if btn(➡️) then
  16.   p.x+=1
  17.  end
  18.  if btn(⬆️) then
  19.   p.y-=1
  20.  end
  21.  if btn(⬇️) then
  22.   p.y+=1
  23.  end
  24.  if btn() then
  25.   p.pv-=1
  26.  end
  27. end
  28.  
  29. function _draw()
  30.  cls()
  31.  map(0,0,0,0,16,16)
  32.  spr(4,p.x,p.y)
  33.  print(p.pv,0,0)
  34. end
Advertisement
Add Comment
Please, Sign In to add comment