Colision between two blocks

Get help using Construct 2

Post » Sun May 31, 2015 3:47 pm

Hey guys, i need a little help. I am making a puzzle game like the puzzles in Goof Troop (snes).

The player is the darker block. When i touch a block, i am making it go forward in the direction that the player is moving.

Everything ok until here, but when i colide two blocks, the moving one enters a little bit in the stopped one. And then, when i try to move the stucked block, it passes the other block like they were not solid.

Any ideas?

Image
Image
B
3
Posts: 4
Reputation: 183

Post » Sun May 31, 2015 11:18 pm

no? :(
B
3
Posts: 4
Reputation: 183

Post » Mon Jun 01, 2015 2:15 am

The layout and the properties aren't useful. A capx or a picture of events is.

I thought there was an example floating around the forum but I couldn't find one, so here's my take.
https://dl.dropboxusercontent.com/u/542 ... _push.capx

I used the 8direction behavior to move the player. I also added CustomMovement and solid to both the player and the boxes. CustomMovement is used for it's "push out of solid" actions and "solid" is used to specify the solids which I toggle on and off.

The general idea is to
1. if player overlaps a box then push the box
2. if the pushed box is then overlapping any other boxes then we need to push back by
a. push the box backwards out of the other boxes
b. push the player backwards out of the boxes.

The only major equation used is to round an angle to the nearest 90, so we get a correct angle to push. Solid is enabled and disabled throughout. The idea is to only enable a solid if we want to push out of it, otherwise it's disabled.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455


Return to How do I....?

Who is online

Users browsing this forum: Laura_D and 21 guests