Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(2 edits)

mget usually works for collision on a tile. Take this function: map(0,0)

Then you have a player:

spr(1,x *8,y *8)

WHY *8 here? Because a tile is usually 8 by 8. And we need it for collision. This is my personal favorite approach. Alternatively you could divide it in the mget function by 8.

So if you want to make a collision, with my style:

if mget(x,y)==tile_1 then print(“cool”) end It will print cool.

Now mget(x,y)==tile_1 is specific to map(0,0)

So you what you want to do is to have mget(x+levelx,y+levely)==tile_1 to make it dynamic to each level.

map(levelx,levely) spr(1,x8,y8) –if you win, the map moves down by 17 if levelWin then levely = levely+17 end

–if you collide with tile_1 then you print cool if mget(x+levelx,y+levely)==tile_1 then print (“cool”) end

(1 edit)

of course you need x and y.

so x = 10; y = 10 should be away from a function associated with TIC(). You could use it in BOOT()