I have a ball game where the ball is suppesed to bounce off of the boundaries to get to the finish(the player draws a set of boundaries and then lets the ball fall and see if it makes it to the finish) similair to paintball at addicting games. It usually works but sometimes the ball goes through the boundaries. It is really bad when i have moving terrain because if the ball is going the opposite dirrection than the terrain it usually goes right through it. Also, I don't know if this can be fixed but sometimes the ball gets inside a line making up the terrain and starts bouncing around inside of the line. I have tried everything from increasing the frame rate to changing the variable values. please help.
heres the code for the ball ( sorry it's so long it repeats once so that the ball bounces off the players terrain as well as the premade terrain):
terrain1 is the existing background and terrain is drawn by the player.
i can upload the .fla if that helps.
Any tips or pieces of code would be greatly appreciated. Thank You
I think it might help if you could see the game so hear is my website. It is the on the magic lines page. I haven't made a menu yet but i will. the red circle is there to skip levels for testing. Just click go on the first level to see what i mean by goining inside the line. Any advice, tips or opinions would be greatly appreciated.
Its the basic idea of using coordinates of a point to detect collision with line. Once the point is moving fast enough, it can start moving from one side of the line and end up on other side once the speed value is added. You could set up collision loop where you move the point by 1 pixel, check collisions, move again by 1 pixel until you have reached the speed value. Increased accuracy of course comes with the price of lower speed.
Please, somebody help i really need to get this fixed. Can anyone help with the collision loop that tonya mentioned. I really have no idea how to do that. If anyone can help please do . I will upload the .fla.