Hello, everyone! I'm making a game in TI-BASIC, and I was wondering... Is it possible to store several enemies coordinates without having to use separate variables for each enemy? I'm sure there has got to be a way, but I can't seem to figure it out.
Is this possible? If so, can anyone lend a hand?
You can store them in lists. For example, you could have two lists that store enemy coordinates, one for their X coordinate, and one for their Y coordinate, or even store both in one list.
Thank you for the pointer in the right direction! Does anyone have any good documentation for learning more about lists and how to use them? I've been messing around for a bit with them, and I'm still having a little bit of trouble figuring it all out from scratch.
I would check out the
tibasicdev page on the subject. It's a very useful resource for all things TI-Basic.
If the window of your graph screen uses integers for deltax and deltay, you could use a string and use sub(expr( to save bytes, and if the number is under ten, just put 0 before it.
For example, {12,9,7,8}->"12090708" or {306,9,87,9}->"306009087
The only downgrade is that strings are a bit slower than lists, but you can use a For( loop to temporarily convert it into a list, then delete the list.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
»
Go to Registration page
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum