Computer Science Canada ball going through the paddle |
Author: | CITC [ Sun Jan 11, 2004 7:39 pm ] |
Post subject: | ball going through the paddle |
has anyone had this problem? In my pong you can send a fast ball which makes the y incriment larger but when it hits the other paddle the y incriment returns to the normal value. so it is possible for the ball to enter too far into the paddle and not be able to get back out.... anyone had this problem / know how to fix it?? |
Author: | Andy [ Sun Jan 11, 2004 8:02 pm ] | ||
Post subject: | |||
well what u can do is instead of having
you have [code] if ballx<=10 and bally<paddlex1 and bally>paddlex2 then bla bla end if [code][/code] |
Author: | CITC [ Sun Jan 11, 2004 8:16 pm ] |
Post subject: | |
I've always done the latter... i don't have this problem very often, mind you. was just wondering if there was any sure way of doing it. |
Author: | Dan [ Mon Jan 12, 2004 12:02 am ] |
Post subject: | |
well i think your problem is that your ball is jumping over the padall. b/c if it incres by alot then it will just go rigth over it. if you have dealys then i gusse you could get ride of them to make it go faster rather then increasing the balls movemt per cycle. |
Author: | Andy [ Mon Jan 12, 2004 8:04 am ] |
Post subject: | |
instead of changing the xchange, y change, y dont u just make the delay shorter |
Author: | Cervantes [ Mon Jan 12, 2004 4:53 pm ] |
Post subject: | |
problem with a shorter delay is then you have less ratio's for paddle : ball speed. Oh well, not a big problem ![]() |
Author: | Andy [ Mon Jan 12, 2004 8:12 pm ] |
Post subject: | |
no see, you can fork the paddle movement |
Author: | Cervantes [ Mon Jan 12, 2004 8:23 pm ] |
Post subject: | |
ooooh forkage... good idea ![]() ![]() |