Restrict Movement to Tile

Get help using Construct 2

Post » Tue May 07, 2013 8:06 pm

Ok here is the breakdown
-Sprite Object
-Grass Tiled Background
-Black Tiled Background

The Grass area is not covering the whole layout but the Black area is. The Grass tile is on top of the Black area.

The goal is to keep the sprite from leaving the Grass area without having to create a separate collision object.

So whatcha got?
B
6
S
3
G
1
Posts: 102
Reputation: 1,379

Post » Wed May 08, 2013 4:10 am



Alright I have a possible solution.

https://www.dropbox.com/s/4s7a932omjjnric/solution.capx?v=0mcng

Might need more details about your game if the above doesn't help.

B
6
S
1
Posts: 19
Reputation: 544

Post » Wed May 08, 2013 7:06 pm

awesome, thanks for taking a swing at that for me. Not quite what i was looking for but that is my fault really for not giving more info on my project.

I am making a top down rpg where players acquire suits that let them travel underground and underwater. I am using 8 dir movement behavior. when the player is wearing a suit that can go underground for instance they click a button and all the surface objects are hidden and the underground objects are made visible and collisions enabled. i do not want them to be able to leave the tiled area as that might be into water or something. it would be nice to have a black layer behind the walkable layer that the player cannot go to. I am hoping to not have to create a barrier object to line the whole map with because I would have to do it for each layer which would be a little tedious.

I am totally holding onto that example for future mechanics in my game though, that is pretty cool.

Thanks!!
B
6
S
3
G
1
Posts: 102
Reputation: 1,379

Post » Thu May 09, 2013 12:24 am

Check if the player sprite is overlapping the desired terrain sprite/tileset.
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,190
Reputation: 18,267

Post » Thu May 09, 2013 3:37 am

yes, I tried that, seems that even if the player is not visibly overlapping the black tiles if it is behind the object the player is currently on it still counts as overlapping it so I cannot use it as a blanket behind everything as I would like.
B
6
S
3
G
1
Posts: 102
Reputation: 1,379


Return to How do I....?

Who is online

Users browsing this forum: Draconinho, peturfoto and 13 guests