Dubbsta
Active member
- Joined
- Jul 13, 2017
- Messages
- 208
im trying different methods to collide with different tiles. so far i tried lists and it worked. i made 6 different size rects and was able to collide with all 6 with one call, but it doesnt seem right to use lilst on an entire level, thats a ton of addlast calls.
This time im trying map[][] =[[0,0,0], arrays where i would try to coll. with 1 and 2 with this call...............................[1,2,0]]
in the main class to get p1 to collide with specific tile images. but it seems like x,y have no real position i think.
i tried different variations of this code and nothing. can someone point me in the right direction. i looked a few places. also what different methods are there. thanks!
This time im trying map[][] =[[0,0,0], arrays where i would try to coll. with 1 and 2 with this call...............................[1,2,0]]
in the main class to get p1 to collide with specific tile images. but it seems like x,y have no real position i think.
i tried different variations of this code and nothing. can someone point me in the right direction. i looked a few places. also what different methods are there. thanks!
Code:
For Local i:= Eachin lvl.map
For Local j:= eachin lvl.map
If lvl.map[i][j] = 1 or lvl.map[i][j] = 2
If p1.x + p1.width >= lvl.x+j and p1.x <= lvl.x+j + lvl.tileSize and
p1.y + p1.height >= lvl.y+i and p1.y <= lvl.y+i + lvl.tileSize
p1.fallspd = 0
End
End
Next
next