How do I lose when i collision with specific side of object?

Get help using Construct 2

Post » Mon Sep 21, 2015 8:30 pm

Hi, i have a box like obstacle in my game, but i want that the player collision with the left side of box lose, but if collision on top or any side, the game continues.

How can i do that??
Thanks
B
4
Posts: 50
Reputation: 290

Post » Mon Sep 21, 2015 8:38 pm

@crynof
I would suggest maybe create a sprite and pin it to the side of your rectangle where you want the collision to occur for you to lose. Make this sprite invisible. Then if your player collides with this invisible sprite, set your actions for your player.
B
28
S
6
G
2
Posts: 86
Reputation: 3,267

Post » Mon Sep 21, 2015 11:38 pm

Is a good idea, but the problem is that i have many boxes, but that boxes have the same properties.
B
4
Posts: 50
Reputation: 290

Post » Tue Sep 22, 2015 12:03 am

Maybe this could help you with that :)
Containers
B
9
S
1
Posts: 50
Reputation: 646

Post » Tue Sep 22, 2015 7:27 am

you could also look at the relative x (&y) coordinates of the two colliding sprites and make a decision on these
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,812

Post » Tue Sep 22, 2015 9:29 am

@crynof

You could use 'overlapping at offset' if player and box both are solid.
Something like:

Player Is overlapping Box at offset(1,0) -> die
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Tue Sep 22, 2015 9:48 am

You might even be able to use the bounding box edges for checking, depending on the way you have set things up..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests