Multiple Collisions Problem [SOLVED] :)

For questions about using Classic.

Post » Fri Mar 12, 2010 12:27 am

Hello there! I'm a new developer on the Construct software; I have switched to Construct after about 5 years developing on Clickteam's software. I think this development software is REALLY amazing, but I'm having a slight issue in the game I'm creating. In my game, which is a relatively simple platformer at the moment, you collect coins by--of course--colliding with them. My problem is that when two coins are close together, and the player touches both coins at the same time, the private variable 'Coins' only adds 1 to its collection instead of 2. Is there any way to fix this? :?
B
4
S
1
G
2
Posts: 54
Reputation: 958

Post » Fri Mar 12, 2010 12:42 am

[quote="joeyapplepi":3c6p1dcw]Hello there! I'm a new developer on the Construct software; I have switched to Construct after about 5 years developing on Clickteam's software. I think this development software is REALLY amazing, but I'm having a slight issue in the game I'm creating. In my game, which is a relatively simple platformer at the moment, you collect coins by--of course--colliding with them. My problem is that when two coins are close together, and the player touches both coins at the same time, the private variable 'Coins' only adds 1 to its collection instead of 2. Is there any way to fix this? :?[/quote:3c6p1dcw]

Can you post a cap?
My thought is change to over lap. Try that that instead of collision.
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Fri Mar 12, 2010 12:43 am

I'm not sure what events exactly you used, but I assume you made it add when the player collides with the coin. Try the inverse, add 1 to the private variable when the coin collides with the player...
Example:
[code:2fnofxk2]
On collision between Coin and Player
> Player Add 1 to 'Coins'
[/code:2fnofxk2]

Instead of

[code:2fnofxk2]
On collision between Player and Coin
> Player Add 1 to 'Coins'
[/code:2fnofxk2]
B
2
G
2
Posts: 16
Reputation: 682

Post » Fri Mar 12, 2010 12:49 am

[quote="Kiloku":1yzjvlok]I'm not sure what events exactly you used, but I assume you made it add when the player collides with the coin. Try the inverse, add 1 to the private variable when the coin collides with the player...[/quote:1yzjvlok]

Hmm... You were right, I did indeed have the player colliding with the coin, but when I switched it around it didn't fix the problem. However, when I combined it with Guyon's tip:

[quote="Guyon":1yzjvlok]My thought is change to over lap. Try that that instead of collision.[/quote:1yzjvlok]

...It fixed the problem entirely. I ran multiple tests to see if it had truly fixed it, and it did. Thanks, guys! ;)
B
4
S
1
G
2
Posts: 54
Reputation: 958


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests