Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
ball going through the paddle
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 ballypaddlex2 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

 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 8 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: