Posted: Wed Mar 22, 2006 12:26 pm Post subject: Basic, but I still need help!
Alright, this is a really basic problem... but, the turing "help" on my computer isn't working and I need help!
I am working on a 'pong' program for my gr 11/12 computer science class. And, i just can't figure out how to get a 'score' br outputted on the same line over and over again... can anyone help?! I'm a total newbie.
Thanks, Jess.
Sponsor Sponsor
Andy
Posted: Wed Mar 22, 2006 12:49 pm Post subject: (No subject)
locate (r,c)
put score
decide where you want the score outputted, and type it in the locate parameters, then put the score right after
NikG
Posted: Wed Mar 22, 2006 1:47 pm Post subject: (No subject)
Obviously, those two lines will have to be in your main game loop or else they'll only show once.
Also, unless you're using cls to clear the screen, you may want to write a blank at the same location after your delay to avoid weird display errors. i.e:
code:
loop
locate(1,1)
put score
delay(100)
locate(1,1)
put " "
end loop
Jessica43999
Posted: Wed Mar 22, 2006 2:18 pm Post subject: (No subject)
Thanks guys!!! That totally helped allot
do_pete
Posted: Wed Mar 22, 2006 2:47 pm Post subject: (No subject)
NikG wrote:
Obviously, those two lines will have to be in your main game loop or else they'll only show once.
Also, unless you're using cls to clear the screen, you may want to write a blank at the same location after your delay to avoid weird display errors. i.e:
code:
loop
locate(1,1)
put score
delay(100)
locate(1,1)
put " "
end loop
No, this is Unnecessary because "put score" clears the entire line, whereas "put score.." doesn't
NikG
Posted: Wed Mar 22, 2006 3:22 pm Post subject: (No subject)