Does anybody know how to access the coordinates of something displayed on the screen in a for loop? (Home Screen)
I'm not sure I understand your question? You want to access the coordinates of something being displayed? Is it already being displayed or do you want it to be displayed?
I try to use the for loop to have better animation in my programs, but I don't know how to access the coordinates of something being displayed by the for loop. Here's an example: I'm trying to make a copy of Frogger for my calc, and I want to use a for loop to display the cars moving on the screen. How do I know when the character collides with one of the cars being displayed by the for loop?
How you handle collision depends on how you are displaying your cars. For loops in general are very simple. You specify a variable, and it loops from the start number to the end number. To access that variable, you can just use that variable. Detecting collision with an object depends entirely on how you are displaying the object.
Most likley you can just detect if your going to hit it by what ever stores the location for your character
the code would look like
if car location = Frogger location : then
clear the home screen and output some losing text
When i run a for loop, everything on the screen disappears except for the stuff displayed by the for loop.
Well what kind of display code do you have inside the For() loop? Are you clearing the screen?
programming freak i went through the same thing when i made frogger. Never actually finished it because i had multiple projects going on at once. but the solution i was working on was storing the cars in a string and using output to display them all at once. and then when you move the frog it checks its location in the string to see if its a space or not
this is what the code looks like, if i can remember correctly.
:For(x,1,16) :Output(X,1,"O :For(Y,1,150) :Clrhome :End
:For(Y,1,150) :Clrhome :End
What is the point of this piece of code? All it looks like it does is clear the screen 150 times. Are you trying to do a delay? Also, if you want to make the O move, instead of clearing the entire screen, why not just display a single space to erase where the O was before, that way you don't have to redraw the screen every frame.