Log In  

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?

P#145489 2024-04-02 15:53

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()

Cart #razihugafe-0 | 2024-04-02 | Embed ▽ | License: CC4-BY-NC-SA

P#145491 2024-04-02 16:06

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)
P#145497 2024-04-02 17:08

Oh that fixed it, thanks a lot!

P#145499 2024-04-02 17:19 ( Edited 2024-04-14 19:39)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-15 12:26:34 | 0.009s | Q:16