TIB: Y-var


[Prev][Next][Index][Thread]

TIB: Y-var




Hey everyone.
I was just attempting to make a simple little game. Not much, just something
to teach myself some of the more advanced methods of TI-Basic, before I
attempt to tackle ASM. Anyways, here's my problem: (and the reason for the
wreckage sitting against my wall that used to be my new TI-83)
The program has an X-var and a Y-var. Together, they give the location of
the little cursor, representing your character. Now, they are set to X=43,
Y=21 (using the graphical screen, set to 94x64) So, it looks like:
:Text(Y,X,"+"

All well and good. Except the calculator places the "+" at something like
5,43. (row, col)
I went through the code over and over and no luck. So I abandoned that and
was amusing myself by making my name go round and round the screen. Yippee,
what fun. It happened again!!!!
It's not long, so I'll type it out:

:ClrHome:ClrDraw
:45->X:40->Y:2->D:2->E
:Repeat K(does not equal)0
:If X(greater than or equal to)80:-2->D
:If X(less than or equal to)5:2->D
:If Y(greater than or equal to)55:-2->E
:If Y(less than or equal to)5:->2->E
:getkey->K
:If K=21:Goto (theta)
:Text(Y,X,"WES"
:For(0,1,5,1)
:5*0->J:END
:Text(Y,X,"           "
:X+D->X:Y+E->Y
:END
:Lbl (theta)

Simple program, makes my name ("WES") bounce around the screen, going off
the sides like a tennis ball.
Well, it's not simple at all!! The outcome of it was to make WES appear at
40,45 on the screen, and then the bouncing, moving WES started at what
appeared to be 0,45, headed down south-easterly way, and then began to
bounce. My question is WHY????? When I changed the "Y" to an "F"...it worked
just fine! What is so special about "Y" and why isn't it working for me?
What did I do to this thing?
Thanks for helping little ol' newbie me
Wes



Follow-Ups: