
-----------------------------------
Jessica43999
Wed Mar 22, 2006 12:26 pm

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?!  :oops: I'm a total newbie.  :cry: 

Thanks, Jess.

-----------------------------------
Andy
Wed Mar 22, 2006 12:49 pm


-----------------------------------
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
Wed Mar 22, 2006 1:47 pm


-----------------------------------
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:

loop
  locate(1,1)
  put score
  delay(100)
  locate(1,1)
  put "               "
end loop

-----------------------------------
Jessica43999
Wed Mar 22, 2006 2:18 pm


-----------------------------------
Thanks guys!!! That totally helped allot :)  :P

-----------------------------------
do_pete
Wed Mar 22, 2006 2:47 pm


-----------------------------------
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:

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
Wed Mar 22, 2006 3:22 pm


-----------------------------------
hmmmm good point do_pete, i forgot that. :oops:
