On Collision issue

Get help using Construct 2

Post » Fri Jan 03, 2014 1:38 pm

Hi

I have a player sprite that dies when it touches the obstacle sprite.
This works until the player sprite partly touches an obstacle sprite that is at the same height as the ground.

When the player sprite partly touches other obstacles (of the same obstacle sprite) the player dies, but not when it partly touches an obstacle of the same height as the ground.

Any ideas where I'm going wrong with this?

Dropbox capx here https://dl.dropboxusercontent.com/u/14979031/RunNJump/RunNJump.capx

Thanks.
B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Fri Jan 03, 2014 2:08 pm

You're not really going wrong anywhere..

If you make a platform on which the player stands and you move to the left or right, the player only starts falling if it is completely free from the platform, the same applies here. the player isn't colliding with the obstacle untill it is completely clear of the ground.

This is built in in the platform behaviour, so you will have to find a way around it to check if the player is colliding on the same level as the ground. (you could use a detection sprite for it, or maybe an imagepoint or overlapping with offset detection)LittleStain2014-01-03 14:09:10
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

Post » Fri Jan 03, 2014 2:17 pm

@nickl That is because your 2nd event only checks collision with the red sprite exclusively. To solve this, use overlap at offset (x=1,y=1) instead of on collision, should do the trick.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 42 guests