Collision issues.

0 favourites
  • 4 posts
  • 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.

  • 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?

    <img src="http://dl.dropbox.com/u/31346541/C2/ballbat.jpg" border="0">

    http://dl.dropbox.com/u/31346541/C2/batball.capx

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Post your capx.

  • 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.html

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)