Computer Science Canada pong help plz :( |
Author: | FakeSound [ Sat May 06, 2006 6:49 pm ] | ||
Post subject: | pong help plz :( | ||
My friend and i are making a game of pong; just a simple game for extra marks in our programming class. However, we're facing a few problems right now... a] i can't get the paddles to stay in the screen (I need to set boundaries, but don't know how) b] the ball doesn't bounce off the paddles (We're not very experienced using whatdotcolor or collision) so ... i'll post my code right here, any help is greatly appreciated.
|
Author: | Clayton [ Sat May 06, 2006 7:03 pm ] | ||
Post subject: | |||
hello welcome to compsci, plz dont post "I need help" or "help plz" as we know you need help, thats why you posted here (in a perfect world), now on to your problem, for the use of whatdotcolor (aka View.WhatDotColor) all you are doing is checking to see if a pixel is a color right? and if your ball has a radius, the best place to check for a collision is on the edge of the ball right? so do something like this
its as simple as that, if you are having any problems with anything check out the Turing Walkthrough good luck on the project!! |
Author: | FakeSound [ Sat May 06, 2006 7:11 pm ] |
Post subject: | |
I just tried inputting that, it didn't work Sorry for posting the 'help plz' . . ummm ... yeah, that didn't work ... if it means anything, i'm using version 4.0.3 but when i tried using that, it said that bounce needs to be declared ... i just can't seem to make the ball bounce off of the paddles. I can get the ball to bouncce off of the walls, that's no problem; however, gettting the paddles to stay within bounds is another thing i can't figure out ... i know this is pretty much a repost of my first post, but .. uhhh... i've clarified as much as i can, sorry ps its making me kinda mad |
Author: | Cervantes [ Sat May 06, 2006 7:24 pm ] | ||||||||
Post subject: | |||||||||
|
Author: | wtd [ Sat May 06, 2006 7:48 pm ] | ||
Post subject: | |||
Cervantes wrote:
That condition so very much needs to be factored out into a function. |