Collision Detection without bouncing off

Get help using Construct 2

Post » Tue Sep 18, 2012 6:41 pm

Hello,

I'm trying to get a solid to just "push out" (as in not let in) the player, which has a bullet behavior, but unfortunately, when "bounce off solids" is disabled, there is just no collision at all (or so it seems, at least). The player just passes straight through the wall.

What can I do to change this?

Thanks in advance,

Wouter

-project file
w0uter2012-09-18 18:52:50
B
2
Posts: 1
Reputation: 277

Post » Tue Sep 18, 2012 8:04 pm

You can test if it's overlapping the wall, then make it do something based on that.

Player > Is overlapping Wall
-------------------------- Player Set Bullet Speed 0

?

Added a demo and CAPX

http://www.johnnysix.net/games/dodgetheballs/

http://www.johnnysix.net/games/dodgetheballs/dodgethis.capxJohnnySix2012-09-18 20:10:18
Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939

Post » Tue Sep 18, 2012 8:12 pm

Also - you can use the clamp function to ensure that the X or Y pos doesn't go outside of certain bounds, if the grey area is simply a visual thing , and it won't be colliding with other stuff in the middle.

Like

http://www.johnnysix.net/games/dodgethegrey/

http://www.johnnysix.net/games/dodgethegrey/dodgethat.capxJohnnySix2012-09-18 20:18:28
Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests