1980gamer Posted July 17, 2018 Share Posted July 17, 2018 I am trying to place 24 sprite on the screen. And in a random sequence, have them start moving. My question is... Can you use a variable to start a sprite moving in a call motion? LET #VAR=3 CALL MOTION(#VAR,20,0) I could swear I have done this in the past? Maybe it was in a Sprite command? Though that will not work for me without a rewrite...... Hmmm..? Quote Link to comment Share on other sites More sharing options...
Tursi Posted July 17, 2018 Share Posted July 17, 2018 Yes, you can do that. But variables don't start with a '#', only the sprite functions require that. VAR=3 CALL MOTION(#VAR,20,0) Quote Link to comment Share on other sites More sharing options...
+mizapf Posted July 17, 2018 Share Posted July 17, 2018 TI (Extended) Basic surely has some syntactic sugar here and there ... 1 Quote Link to comment Share on other sites More sharing options...
1980gamer Posted July 17, 2018 Author Share Posted July 17, 2018 Thanks for verifying it should work. The LET #VAR was a typo... But maybe I had the same typo while testing? #VAR would be a local TEMP TABLE in SQL... So it may have looked correct to me? Sample proof of it working... 1 CALL SCREEN(2)10 CALL CLEAR20 RANDOMIZE30 CALL SPRITE(#1,42,12,120,120)40 CALL SPRITE(#2,42,13,128,128)50 CALL SPRITE(#3,42,14,112,112)60 R=INT(RND*3)+170 CALL MOTION(#R,10,10)80 FOR D=1 TO 500 :: NEXT D90 CALL MOTION(#R,0,0)100 GOTO 60 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.