Author |
Message |
CITC
|
Posted: 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?? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Andy
|
Posted: Sun Jan 11, 2004 8:02 pm Post subject: (No subject) |
|
|
well what u can do is instead of having
code: |
if ballx=10 and bally<paddlex1 and bally>paddlex2 then
bla bla
end if
|
you have
[code]
if ballx<=10 and bally<paddlex1 and bally>paddlex2 then
bla bla
end if
[code][/code] |
|
|
|
|
|
CITC
|
Posted: Sun Jan 11, 2004 8:16 pm Post subject: (No 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. |
|
|
|
|
|
Dan
|
Posted: Mon Jan 12, 2004 12:02 am Post subject: (No 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. |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
Andy
|
Posted: Mon Jan 12, 2004 8:04 am Post subject: (No subject) |
|
|
instead of changing the xchange, y change, y dont u just make the delay shorter |
|
|
|
|
|
Cervantes
|
Posted: Mon Jan 12, 2004 4:53 pm Post subject: (No subject) |
|
|
problem with a shorter delay is then you have less ratio's for paddle : ball speed. Oh well, not a big problem |
|
|
|
|
|
Andy
|
Posted: Mon Jan 12, 2004 8:12 pm Post subject: (No subject) |
|
|
no see, you can fork the paddle movement |
|
|
|
|
|
Cervantes
|
Posted: Mon Jan 12, 2004 8:23 pm Post subject: (No subject) |
|
|
ooooh forkage... good idea I'll try that out when my eng presentation is done (speaking of which, I should do that ) |
|
|
|
|
|
Sponsor Sponsor
|
|
|
|