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

Username:   Password: 
 RegisterRegister   
 Request
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Lierro




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




PostPosted: Tue Jun 10, 2003 9:58 am   Post subject: (No 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
Tony




PostPosted: Tue Jun 10, 2003 1:33 pm   Post subject: (No subject)

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

then read tutorial on collision detection before adding the ball to your program.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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  [ 3 Posts ]
Jump to:   


Style:  
Search: