This commit is contained in:
2025-12-28 20:28:14 +01:00
parent 34d70d8be9
commit f28a65d1f8
2 changed files with 43 additions and 18 deletions

View File

@@ -1,11 +1,29 @@
function playercontroler_init()
mposx=0
mposy=0
poke(0x5F2D,1)
end
function playercontroler_update()
mposx=stat(32)
mposy=stat(33)
cposx=mposx-4
cposy=mposy-4
ccellx=flr(mposx/16)
ccelly=flr((mposy-8)/16)
sprite = mget(ccellx*2, ccelly*2)
flag = fget(sprite)
end
function playercontroler_draw()
function playercontroler_draw()
spr(16, cposx, cposy)
rect(ccellx*16,(ccelly*16)+8,(ccellx+1)*16, ((ccelly+1)*16)+8,7)
print("mouse pos:"..mposx..", "..mposy,5,100,0)
print("cell pos:"..ccellx..", "..ccelly,5,110,0)
print("flag:"..flag,5,120,0)
end