How do I create tiles with different properties?

Get help using Construct 2

Post » Wed Nov 12, 2014 11:30 pm

Fantastic and many thanks again.I have managed to rip the code from the example and modify mine and eventually once I realised I had changed the point of origin to the bottom of the player and removed the +32 from the Y position it worked perfect. Yay. Gonna have a break from it now and carry on tomorrow. Great support and thanks again. Jim
B
4
Posts: 22
Reputation: 244

Post » Wed Nov 12, 2014 11:41 pm

I carried on messing with my example and added very basic platform logic to the tile checking.

Added a spring - Up arrow on tilemap
Added conveyor left & right - left & right arrow on tilemap (this needs a bit more thought to it to make it work correctly i.e you stop before falling off the edge due to tile checks)

tileat - expanded.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 » Thu Nov 13, 2014 8:13 am

Thats great and helps to show me how you add this type of thing to a game as I was confused on how to apply these type of checks in Construct. I am now trying to figure out if it is possible to have some tiles as solid and some as 'walk through' in the same tilemap? I am guessing I will have to check what time is to my left or right and then do an action to let it walk through somehow?

Anyway the demo you did has been a great help and much appreciated.

The conveyor blocks I only just noticed doh! Another major help and looking at the code fairly simple to implement so a ladder type one could be similar in principle.
B
4
Posts: 22
Reputation: 244

Post » Thu Nov 13, 2014 8:23 am

Got conveyor block to work, yay!
B
4
Posts: 22
Reputation: 244

Post » Thu Nov 13, 2014 10:01 am

Not sure if I need to do a different post for this question as it may help others looking for a similar solution but I am now faced with a tilemap where some of the blocks are solid and some are walkthrough. I have read the properties and info re 'solid' and it seems I cannot do it with a single tilemap as there is a danger of the player getting stuck in a block so my thinking is that I will need to create another map of the same dimensions with its own blocks that are all walkthrough and then compare where the player is at on both the solid and non solid tilemaps to ensure I do the correct action.

EG: I have a ladder block, I have already made it so that the player when standing on it will move up automatically but of course the block is solid so I cannot walk into the block which is what I need. If I want to do this behaviour will I need more than one tilemap and is it possible to have more than one on the same level?

Hope that makes sense, if not then I might be able to upload the game so you can see exactly what I am trying to do.
B
4
Posts: 22
Reputation: 244

Post » Sun Nov 16, 2014 10:27 pm

Hi fellas, I'm having some trouble with tilemap and collisions. Opened a new thread, but I'm still looking around for an answer, maybe you can help... The thing is, I have the following setup:

white squares jumptrough tilemap z-index 0, black squares solid tilemap z-index 1, and a platform behavior sprite.

I'd like to achieve that the black square on collision with sprite gets deleted so that white square tile gets revealed from underneath. I'm having trouble identifying the tile's x, y since the sprite's x, y is in respect to Cartesian coordinate system and the tile's x, y is in respect to tile's position in the tilemap... Here's a simple set up I've created so if anyone has a min or two to take a look:

https: // dl.dropboxusercontent.com / u / 6116050 / tileeraseoncollision. capx
Image
B
7
S
1
Posts: 70
Reputation: 843

Post » Sun Nov 16, 2014 10:36 pm

This is a working version of your .capx.

I added an image point named "erase" and used that to test for tiles.

tileeraseoncollision.capx


Your version didn't work because you used the sprites X&Y which are in the centre and there will never be a tile at that position to check against.
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 » Sun Nov 16, 2014 11:25 pm

thank you Minor, helped me a lot, never even heard of "image points" :) ! One more thing... How could I implement a "flash" of that tile lasting 0.5 s, and then deletion of it?

Firstly, if I use flash behaviour on Tilemap, entire tilemap flashes, and if I use Wait 0.5 sec, then since the Sprite moves along in that 0,5, the "erase tile in respect to sprite x, y" will erase some other tile and not the one that was hit 0,5 sec ago...

I'd like to achieve that player hits a tile, it flashes for 0,5 sec and then it gets "changed" (erased)...

Anyhow, thanx for your help!
Image
B
7
S
1
Posts: 70
Reputation: 843

Post » Mon Nov 17, 2014 8:19 am

I would take a note of the tile positions and store them in Variables on collision so then you do not need to worry about it getting the wrong one after waiting .5 (unless it hits another one in that time).
B
4
Posts: 22
Reputation: 244

Post » Mon Nov 17, 2014 7:51 pm

yeah, no go... I think I found a solution, I just can't make it work (need some help)... So, collision with a tile erases the tile but spawns the sprite (same png) with flash behavior that flashes for 0,5 sec and gets destroyed when flashing ends... I just don't know how to spawn a sprite at exact same place the tile was :(
Image
B
7
S
1
Posts: 70
Reputation: 843

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests