I am thinking of converting a pen-and-paper game that a friend of mine made to the calculator. It is a turn-based strategy game, and probably could be put on the calculator - except I need to see if anyone has any suggestions on a better way of implementing this

I am using Xlib - terrain in background and then the troops and buildings put on that.

So so far I think it will require ATLEAST 3 matrices

[A] - terrain
[B] - player 1 units and buildings
[C] - player 2 units and buildings

Now I think that to hold the HP for each of these units I need to use [D] and [E]

If it was not for the fact that I am using Xlib for the graphics, I would probably use lists and have each number in [B] and [C] reference a position in the list -
LPL1UN - the type of unit pl1
LPL1HP - hp of unit pl1

and ditto for player 2 (except using pl2 of course =P)

My question is does anyone have another solution that I could use while still allowing the use of Xlib.
Well, stats should be stored via list, matrices are too expensive mem wise to be wasting on stats.

Also, keep somethings that are not needed at all times archived.
The problem is I would need a way to access each part of the list, and I would probably store that in the matix if it wasn't for the fact that the matrix was used for displaying to >.<
Well, what I do is map out what I want the program to do on paper, and then write out a general idea on how the code should look, before I even open up the editor.

Try writing it out 2 or 3 different ways. How do you think I have managed to do some of the stuff I have? And you do realize you can use 2 variables, that everyonce in a while update a list that stores the values of where the person is? There are plenty of variables to use...

Just get creative with what you want. Grab a manual and start looking at different commands, see if any of them will help in anyways...
One solution might be to have 3 lists for each player and store the current location of the unit (there will be a lot to), and then search the list until the unit location matches up... That probably will work to =D thanks!

To bad there isn't a built in inlist function to speed up things =P
You could condense the stats matrices by using complex numbers or integer and fractional parts... This however, will slow the program down, but if it is turn based, that shouldn't matter too much.

NOTE: This depends a lot upon how you plan on doing the graphics. You have to have integers for xLib, but for anything that is not xLib graphic based, you can condense those.

As for stats - if there isn't TOO much editing, I would definitely go with strings and use Expr(. Strings don't use up much memory, they have the Instring feature and they are editable.

Lists are nice, but they definitely need a inlist function.

Can you post what you have so far? I would like to see what you are doing...

Other than that, you can always make the map smaller
Razz
I really haven't done much except some sprites. I am worrying about my exams right now. Then I will finalize my project for the contest. And then I will work on a demo, although I am not so sure I can really do it...
  
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
Page 1 of 1
» All times are UTC - 5 Hours
 
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

 

Advertisement