Log In  
Follow
Nedim
[ :: Read More :: ]

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

[ :: Read More :: ]

I wrote a function that shows the mouse coordinates and sprite number of the map tile you are hovering over. I originally wrote this for myself to make checking the tiles on my map easier but figured I could share it in case anyone else finds it useful.

function debug_mouse()
    local mx,my = mouse()
    local x_offset=5
    local y_offset=5

    --window width and height
    local w=480
    local h=270

    --offset if box leaves screen
    if mx>w-20 then x_offset=-15 end
    if my>h-29 then y_offset=-24 end

    --draw debug text box
    rectfill(mx+x_offset-1,my+y_offset-1,mx+x_offset+14,my+y_offset+23,1)
    print(mx,mx+x_offset,my+y_offset,8)
    print(my,mx+x_offset,my+y_offset+8,9)
    print(mget(mx,my),mx+x_offset,my+y_offset+8*2,10)
end
P#145485 2024-04-02 15:44