in my Pong game im trying to hybird sync and cls to create adesired effect. Im making a pong game with no sprites. however i want to use sync do to the increased speed (sync rate 60) problem is im using
to display my scores,debug information ect. and when the screen is syncd the next redraw of the text is re created, is there a way to only clear the text on the screen or something?
(source code included)
Rem Project: pong8
Rem Created: 4/12/2008 8:57:53 PM
Rem ***** Main Source File *****
set display mode 320,240,32
sync on
sync rate 60
hide mouse
cls 0
draw sprites first
Remstart
begin basic variables here
////////////////////////////////////////////////remend
menu_up=1
s1=0
s2=0
p1y=83
p2y=83
bally=83
ballx=298
current_sync=0
Remstart
begin main control loop here
///////////////////////////////////////////////remend
do
if menu_up=1
`display menu
set text font "courier new"
set text size 72
text 35,30,"-PONG-"
set text size 20
text 40,100,"-Press any key to begin-"
if scancode()<>0
menu_up=0
cls 0
set text size 12
endif
else
`run game
`draw scores
text 5,5,"P2 Score: " + str$(s2)
text 155,5,"P1 Score: " + str$(s1)
line 15,15,15,180
line 15,15,305,15
line 305,15,305,180
line 305,180,15,180
text 15,185, "Debug information:"
text 15,195, "ball x: " + str$(ballx) + " ball y: " + str$(bally) + " player1 y: " + str$(p1y) + " player2 y: " + str$(p2y)
text 15,205, "Constants:"
text 15,215, "top y: 15 bottom y: 180 left x: 15 right x: 305"
text 15,225, "sync: " + str$(current_sync)
endif
inc current_sync
sync
loop