Computer Science Canada

Request

Author:  Lierro [ Tue Jun 10, 2003 8:32 am ]
Post subject:  Request

I know I have already asked everyone for help with my pong game and I have had some replies but not enough help.
I am going to show you my game so that you can give me some inside.
Just to let you all know that I am new to this program so nothing too tricky o.k. Smile

var a1,b1:int:=1
var a2,b2,x:int
var c:string (1)

loop
a2:=a1+50
b2:=b1+50
cls
drawfillbox (a1,5,a2,0,10)
drawfillbox (b1,(maxy-5),b2,maxy,10)
getch (c)

x:= ord (c)
if x = 203 then
a1:= a1-7
elsif x = 205 then
a1:= a1+7
elsif x = 97 then
b1:= b1-7
elsif x = 100 then
b1:= b1+7
end if

if a1 <= 1 then
a1:= 1
elsif a2 >maxx then
a1:=(maxx-51)
elsif b1 <= 1 then
b1:= 1
elsif b2 >= maxx then
b1:=(maxx-51)
end if
end loop

This is just my paddles. I have not yet to get the ball in.
Comments welcome

Author:  Prince [ Tue Jun 10, 2003 9:58 am ]
Post subject: 

put setscreen("nocursor") at the top b4 the loop, that way u wont hav the cursor flashing in the paddle... and try and make it so that u can take 2 commands at a time cus with 2 players it would b kinda weird goin one at a time Confused

Author:  Tony [ Tue Jun 10, 2003 1:33 pm ]
Post subject: 

yeah... you have to use Input.KeyDown for that

then read tutorial on collision detection before adding the ball to your program.


: