I am trying to make a top down RPG in Picotron and I want to use a combination of mget() and fget() to make collision. I understand that fget is a bit weird in Picotron but mget is also acting strange as it only reads the sprite numbers of 4 sprites in a 2x2 formation on the 0,0 corner of my map.
Is anyone else experiencing this or could this just be me being silly?
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/49599/10_2_1695072412@01744366.png)
After messing around with it some more it seems it is actually only reading a value when checking one of those 4 corner tiles but I can not figure out what what sprite number it is printing. I included my cart if anyone wants to check for themselves.
The little text box by the mouse is a thing I made that shows mouse coordinates and the output of mget()
![](/gfx/play80.png)
![](/bbs/thumbs/pico64_razihugafe-0.png)
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/bimg/pi/pi4.png)
mget uses cell x, cell y as opposed to pixels. The default tile/cell is 16 by 16 pixels. So divide your mousex and mousey by 16 to get the cell you want. For example the top left tile would be mget(0,0), the next one over is mget(1,0) etc..
Try changing your print line to this..
print(mget(mx/16,my/16),mx+x_offset,my+y_offset+8*2,10) |
[Please log in to post a comment]