How do I create tiles with different properties?

Get help using Construct 2

Post » Tue Nov 11, 2014 9:36 pm

My first post and I am trying to do a version of an 80's platform game I worked on back in 84 (very similar to Manic Miner). I need to be able to set different properties to specific tiles and am not sure despite hours of online searching. I have four main types for this game; 1 solid wall block, 2 Jump thru but stand on block, 3 collapsible block and finally a block that moves the player either right or left if the walk on it (conveyor). Without creating different layers and tilemaps for each type of tile how can I do it? Any help would be appreciated. Cheers, Jim
B
4
Posts: 22
Reputation: 244

Post » Tue Nov 11, 2014 9:48 pm

Use Array for all your data values (tiles numbers, positions, etc) and then simply fill tilemap with data from array.
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 35,968

Post » Tue Nov 11, 2014 11:41 pm

Hi, the map(s) or more accurately each level has already been done in Tiled as I was trying to use a cocos2d based engine but found learning C# to time consuming for now so hoped C2 would work. I am not understanding exactly what you are meaning re filling tilemap with data (unless you mean whats in the tmx files already?) What I am wanting to do is if the player walks on the conveyor block it moves him left/right or if he touches the ladder block in the tileset he starts to move up etc. Does that make sense? I just tried to create it via a sprite but alignment is a nightmare and creating 20+ sprites for just the conveyor blocks seems wasteful? I am sure I am missing something
B
4
Posts: 22
Reputation: 244

Post » Wed Nov 12, 2014 12:02 am

You can compare what Tile ID is currently in collision with Sprite. So if Sprite is in collision/overlapping tileID=6 (ladder for example) -> do some stuff with sprite
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 35,968

Post » Wed Nov 12, 2014 3:44 am

Why the opposition to different tilemaps?

I am guessing your mentality behind that is to avoid a mess in the editor?

If so, make one tilemap who's only purpose is for editing, and how ever many tilemaps you need for your different tile types. Then on the start of the layout, loop through editor tilemap and use that to populate the secondary tilemaps.

I am using this approach currently in a game that I am making.

TileDemo.png


I have a static tilemap size that I am using, but if you need it to be dynamic, simply replace the the limits in the for loops to tilemap.width % [tilesize] and it should automatically cover the full tilemap.
You do not have the required permissions to view the files attached to this post.
B
10
S
3
Posts: 46
Reputation: 820

Post » Wed Nov 12, 2014 2:30 pm

shinkan wrote:You can compare what Tile ID is currently in collision with Sprite. So if Sprite is in collision/overlapping tileID=6 (ladder for example) -> do some stuff with sprite


Thanks for the replies. Re above, that is pretty much exactly what I am wanting to do but simply do not know using Construct how I go about doing it? Eg How do I 'test which block the sprite is standing on' for example? Where is the option for me to access those kind of things which is basically how I did it on the Memotech and others all those years ago.

Re having more than one tilemap. I was just thinking that if it is not possible to check what tile I am on (have not found out how to as said above as yet) then having different maps would allow for this perhaps but I would much prefer the simple option of creating an action based on what tile I am on so I can then have specific actions for Ladder,Spike,Key etc.

Hope I am making myself clear as is it not always easy to write down things. Jim
B
4
Posts: 22
Reputation: 244

Post » Wed Nov 12, 2014 10:25 pm

Ok, I have spent pretty much the whole evening going through the search/topics and manual and cannot find anywhere that refers to how I can detect which block in a tileset my player is standing on at any one time? I am sure it must be possible but so far I cannot find out how and none of the options in any of the menu's are specific to this task that I can see so need someone who has done this before to help me please? Pulling my hair out at now with it cos it must be simple...
B
4
Posts: 22
Reputation: 244

Post » Wed Nov 12, 2014 10:37 pm

This should help.
You do not have the required permissions to view the files attached to this post.
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 35,968

Post » Wed Nov 12, 2014 10:42 pm

Here's an example of getting the tile information around the player in a platform game.

tileat.capx
You do not have the required permissions to view the files attached to this post.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Wed Nov 12, 2014 10:45 pm

Cheers guys, will take a look at them and see how I can adapt them to my game. VERY much appreciated...
B
4
Posts: 22
Reputation: 244

Next

Return to How do I....?

Who is online

Users browsing this forum: banquetburger, Google [Bot] and 20 guests