Computer Science Canada

Does someone know how to make paddles for pong that work?

Author:  dude3000 [ Sun Jan 11, 2004 12:44 pm ]
Post subject:  Does someone know how to make paddles for pong that work?

Does someone know how to make paddles for pong that work? I got the bouncing ball but i have a problem with making a counter and making the paddles move

Author:  poly [ Sun Jan 11, 2004 12:49 pm ]
Post subject: 

If you search you should be able to find a few topics on pong. I think there was a pong game posted in the Submissions forum you could checkout and see how to do

Author:  dude3000 [ Sun Jan 11, 2004 2:00 pm ]
Post subject: 

poly wrote:
If you search you should be able to find a few topics on pong. I think there was a pong game posted in the Submissions forum you could checkout and see how to do


I know that there are games, but I need the actual text so I can see how they made it

Author:  Andy [ Sun Jan 11, 2004 2:29 pm ]
Post subject: 

read up on the Input.KeyDown

Author:  Thuged_Out_G [ Sun Jan 11, 2004 2:56 pm ]
Post subject: 

drawing the paddle is the easiest part of pong lol
code:

drawbox(x,y,x1,y1,color)

Author:  CITC [ Sun Jan 11, 2004 6:06 pm ]
Post subject: 

code:
drawfillbox (10, 10, 60, 15, 12)
var paddle : int := Pic.New (10, 10, 60, 15)
cls
var paddlex : int := 50
var keys : array char of boolean
loop

    Input.KeyDown (keys)
    if keys (KEY_RIGHT_ARROW) then
        paddlex -= 1
    end if

    if keys (KEY_LEFT_ARROW) then
        paddlex += 1
    end if
   
    Pic.Draw (paddle, paddlex, 20,picCopy)
end loop


you should also use View.Set ("offscreenonly") if you aren't already.

Author:  dude3000 [ Sun Jan 11, 2004 10:32 pm ]
Post subject: 

CITC wrote:
code:
drawfillbox (10, 10, 60, 15, 12)
var paddle : int := Pic.New (10, 10, 60, 15)
cls
var paddlex : int := 50
var keys : array char of boolean
loop

    Input.KeyDown (keys)
    if keys (KEY_RIGHT_ARROW) then
        paddlex -= 1
    end if

    if keys (KEY_LEFT_ARROW) then
        paddlex += 1
    end if
   
    Pic.Draw (paddle, paddlex, 20,picCopy)
end loop


you should also use View.Set ("offscreenonly") if you aren't already.



THANK YOU VERY MUCH!!!!

Author:  McKenzie [ Sun Jan 11, 2004 10:48 pm ]
Post subject: 

Dude, poly is actually not trying to be a jerk (I was earlier, but that's beside the point). I just spent 2 min following his advice, guess what? it was not hard to find full versions of pong. no, not .exe, .t


: