Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 ball going through the paddle
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
CITC




PostPosted: 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
Sponsor
sponsor
Andy




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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 Neutral
Andy




PostPosted: Mon Jan 12, 2004 8:12 pm   Post subject: (No subject)

no see, you can fork the paddle movement
Cervantes




PostPosted: Mon Jan 12, 2004 8:23 pm   Post subject: (No subject)

ooooh forkage... good idea Very Happy I'll try that out when my eng presentation is done (speaking of which, I should do that Thinking )
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: