
-----------------------------------
Code_Urban
Thu Nov 04, 2004 9:20 pm

Pong Game..score dont add up...any suggestions?
-----------------------------------
for some reason when i let the ball ust bounce on the right and left sides..the score dont add...can anyone suggest anything...and as u can see, me nad my class are just starting and all we've been using are  if statements....we know all varibles and crap like that...its just that tthe ball.......trying a lot to fix it........the score dont add...so plz give me suggestions just on the BALL SCORE...and its at the bottom   (its bolded)

View.Set ("graphics:640;480,offscreenonly")

var x,y,:int
var x1,y1,x2,y2 :int
var xstep, ystep:int :=5
var key :string (1)
var p1move, p2move:int
var colourpad,ballcolour, ballcolour1:int
va ballx,bally,rad,p1score,p2score:int
var font1:int : = Font.New ("Bookman Old Style BT:12")
var font2:int : = Font.New ("Comic Sans MS BT:12:underline")

x:=360
y:=240
colourpad:= 6
x1:=10
y1:=180
x2:=620
y2:=180
p1move:=25
p2move:=25
p1socre:=0
p2score:=0
rad:=5

loop
drawfillbox (640,0,0,480,9)
drawfillbox (0,440,640,480,7)
Font.Draw ("Player 1: ",10,450,font1,0)
Font.Draw ("Player 2: ", 490,450,font1,0)
Font.Draw ("Score", 280,465,font2,0)
drawfillbox (x1,y1,x1+10,y1+50,colourpad)
drawfillbox (x2,y2,x2+10,y2+50,colourpad)
x:=x + xstep
y:=y + ystep
    if x > 630 or x < 10 then
	xstep := - xstep
end if
    if y > 430 or y < 10 then
	ystep := - ystep
end if

if hasch then
getch (key)
    if (key = "A' or key = "a" ) and y1 < 300 then
	y1 := y1+p1move
end if
    if (key = "Z" or key = "z") and y1 > 5 then
	y1 := y1-p1move
end if 
    if key = chr (200) and y2 < 440 then
	y2 := y2 +p2move
end if
    if key = chr (208) and y2 > 5 then
	y2 := y2-p2move
end if 

if x + rad >= x2 then
   if y >= y2 and y  5 then
	y1 := y1-p1move
end if 
    if key = chr (200) and y2 < 440 then
	y2 := y2 +p2move
end if
    if key = chr (208) and y2 > 5 then
	y2 := y2-p2move
end if 

if x + rad >= x2 then
   if y >= y2 and y 