How do I stop movement before a collision

Just started using Construct 2? Post your questions here

Post » Tue Feb 03, 2015 6:45 am

Hello, I'm trying to make a tile game. I'm moving the tiles by using set position. I only want certain things to happen when only certain types of tiles collide into each other. Otherwise, I want the tiles to not be able to move.

I have tried using solids and collision detection, but I cannot seem to stop them from simply overlapping each other in the movement.
B
3
Posts: 3
Reputation: 181

Post » Tue Feb 03, 2015 11:23 am

Think you need to supply a bit more information. When you say tile game, you mean tilemap? or do you mean sprites that moves based on a fixed ratio, so it appear as if its tiles?
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,828

Post » Tue Feb 03, 2015 4:46 pm

Well, the game movement is similar to that of a sliding puzzle. The way I have it set up is that there are eight boxes where different pieces can slide to. Each slide creates a new piece that can either go into different slides or get stuck if no move is available.

The sprites or tiles do move at a fixed ratio so they do not go outside of my boxes.
B
3
Posts: 3
Reputation: 181

Post » Tue Feb 03, 2015 4:52 pm

Could you provide a capx? That would make it easier to diagnose.
I like giving game advice more than I actually like making games ;)

Image
B
40
S
15
G
3
Posts: 129
Reputation: 4,651

Post » Wed Feb 04, 2015 1:01 pm

deadman85 wrote:
I have tried using solids and collision detection, but I cannot seem to stop them from simply overlapping each other in the movement.

check your collision polygon.
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
62
S
14
G
2
Posts: 286
Reputation: 6,576

Post » Sat Feb 07, 2015 7:35 am

I've thought about my question a bit more. I'm still having the issue.

The collision polygon looks fine. Maybe this will put my question into better terms.

Is there a possible way to set sprites as a solid while only using set position to move the sprites?

I can not make my sprites move the way I want them to with the behavioral movements. I need to use set position, but I also need them to be solid.
B
3
Posts: 3
Reputation: 181

Post » Mon Feb 09, 2015 3:09 pm

There was an example of this, somewhere I dont remember. It was about grid movment and will stop the player from walking over the rocks. Did you try something like:

Keyboard---Right arrow down & player --- (invert)is overlapping "Wall" at offset(0,-gridsize) ----- then move

It a little hard to understand it that way. I will try to find the tutorial.

Edit: here is it, maybe I will help you. Note, fix the url because I cant post them.

http s:// w ww.scirra.com/tutorials/1094/grid-based-movement
B
8
Posts: 26
Reputation: 348


Return to Beginner's Questions

Who is online

Users browsing this forum: Koronello and 3 guests