Collision issues.

Get help using Construct 2

Post » Thu Apr 05, 2012 1:39 am

So I have a ball. The ball has the properties of a bullet with a speed of 100 at the default angle of motion of 0 degrees. When the ball collides with a solid black block called ballblockright, the balls angle of motion is set to 180 and it turns around. Once it collides with ballblockleft it is turned back around with a 0 degre angle of motion. So the problem is this doesn't happen. This actually worked for me for the first while that I used it. Now, with nothing changed, it doesn't work anymore. The ball for some reason is ignoring the collisions with the blocks. And if it doesn't ignore it off the bat, it does shortly after. Any ideas?

EDIT: Here's a question. If I have the event set up like so:

If ball collides with ballBlockRight: Ball.Bullet.AngleOfMotion = 180

Does that change all of the balls angles of motion to 180? If so I can see the flaw with my system. Also, if so, is there a way to make that statement only apply to the relative ball?

*EDIT: I have confirmed that with just 1 ball object, and 1 ballBlockRight, and 1 ballBlockLeft the collision still is no longer occuring. Either I'm missing something stupid, or I might have found a bug with the software. This method worked fine up until a bit ago.
Jhagor2012-04-05 01:46:42
B
3
Posts: 5
Reputation: 285

Post » Thu Apr 05, 2012 2:18 am

I did a quick test with the setup you're describing and it worked fine. Maybe there is something else in your event sheet that's causing the problem?

http://dl.dropbox.com/u/31346541/C2/batball.capx
B
8
S
3
G
4
Posts: 22
Reputation: 2,717

Post » Thu Apr 05, 2012 2:31 am

Post your capx.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,786

Post » Thu Apr 05, 2012 2:49 am

EDIT: Found the problem. The conditions were reversed. What happened was the way I had it set up with just 1 block originally adding 180 degrees to the angle of motion every time it collided was pulling the current angle of motion from a random object, causing balls that weren't supposed to turn around to do so. Then when I switched it to left and right blocks, I got the angles reversed, essentially sending the balls straight in the same direction when they collided. Blah.

*EDIT: Here's the link to the working version of the game so far. You can see the balls I was referring to. It's a basic platformer, incomplete, with only 8 levels to play through so far.

http://dl.dropbox.com/u/71081567/JumpJump/index.htmlJhagor2012-04-05 03:04:53
B
3
Posts: 5
Reputation: 285


Return to How do I....?

Who is online

Users browsing this forum: plinkie and 20 guests