http://calcg.org/newlogo2.png Not Logged in.
Login | Register

General Discussion Board \ Calculator Discussion \ program movement help

Click here to log in (you must be logged in to post comments).

AuthorComment
thunderflea
Marine
Posted: 21 Oct 2009
18:10 GMT
Total Posts: 15
i want a * symbol to move up and down, not bye arrow keys just move up and down.
heres my program help fix my errors Also ü= a ->
ClrHome
4->X
8->Y
Lbl 1
Output(X,Y,"X
While 1
getKey->G
While G=0
getKeyüG
End
If G=24
Goto L
If G=25
Goto U
If G=26
Goto R
If G=34
Goto D
If Gø24 or 25 or 26 or 34
Goto 1
Lbl L
Output(X,Y,"
Y-1üY
If Y=0
16üY
Goto 1
Lbl U
Output(X,Y,"
X-1üX
If X=0
8üX
Goto 1
Lbl R
Output(X,Y,"
Y+1->Y
If Y=17
1üY
Goto 1
Lbl D
Output(X,Y,"
X+1->X
If X=9
1->X
Goto 1
haveacalc
Guardian
avatar
Posted: 22 Oct 2009
07:22 GMT
Total Posts: 1111
Here is a program to make an asterisk move up and down on the eighth column:
2→A
1→B
1→C
ClrHome
While 1
Output(8,A,"*
Output(8,B,"
A→B
A+C→B
if A=1 or A=8
-C→C
End


---
-quoted directly from most movies that don't exist (and some that do).
Vectris
Ultralisk
avatar
Posted: 22 Oct 2009
14:28 GMT
Total Posts: 375
Haveacalc's a bit rusty ;)

It should really be this.

2→A
1→B
1→C
ClrHome
While 1
Output(A,8,"*
Output(B,8,"
A→B
A+C→A
If A=1 or A=8
-C→C
End

It goes really fast but as soon as you put your game code or anything else in the While loop it will so slow WAY down. If you don't have any extra code to add and just want this "animation" by itself you can slow it down with any empty For Loop like this.

For(X,1,100
End

Adjust 100 for the length of time.
haveacalc
Guardian
avatar
Posted: 22 Oct 2009
15:42 GMT
Total Posts: 1111
Yes, the second store to B should be to A instead and "if" should be capitalized. Keep in mind, thunderflea, that you can use a simpler command - cos(0) - if a "for" loop causes too much delay in your program.

---
-quoted directly from most movies that don't exist (and some that do).
Vectris
Ultralisk
avatar
Posted: 22 Oct 2009
18:21 GMT
Total Posts: 375
and you mixed up the coordinates for Output()

btw it is nice code though, my attempt was a couple lines longer.





Portal | My Account | Register | Lost Password or Username | TOS | Disclaimer | Help | Site Search | File Archives Copyright © 2002-2019 CalcG.org