Selecting Tiles and collisions

Just started using Construct 2? Post your questions here

Post » Sun Sep 13, 2015 2:18 am

is there a way to select a tile by its X, Y, and ID?
and then do different collisions depending on the Tile ID?
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Sun Sep 13, 2015 3:41 am

There is the Tilemap.positionToTileX(xcoordinate) and Tilemap.positionToTileY(ycoordinate) for retrieving the tile X and Y. And there is the Tilemap.tileAt(tilex,tiley) to get the ID. If the ID is -1, then no tile exists at that location.
You can check if a point overlaps with a Tilemap in the system expressions, and use the point's coordinates to get the tileX,tileY , and then from those the ID. That way, you'll be able to check collisions based upon the tile ID.
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Sun Sep 13, 2015 8:32 pm

Ya I'm just going to use an object map instead of a tile map that way I can do normal object calculations
However I do need to post a topic about that

Edit: inless there is a way to select a tile ID like an object
so I can use path finding
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Sun Sep 13, 2015 10:01 pm

How many different types of collisions do you need? You could use a separate tilemap for each collisions type. You would just place the tiles on one tilemap that relate with a specific collision type, etc...
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Sun Sep 13, 2015 10:34 pm

well I know but if I use tiles I couldn't use things like pathfinding
or am I wrong?

Edit: I move the Grid path finding question to Here
B
13
S
6
G
1
Posts: 149
Reputation: 1,960


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest