none
Can I write a library for small basic in small basic and if so, how? RRS feed

  • Question

  • I'm a beginner programmer. I had no idea where to start programming until an ITT Programmer I was shadowing for a SABA trip told me about small basic. From what I've seen so far I can probably do a lot with it.

    My friends created a strategy board game and have been thinking that it would be fun as a computer game, and currently being the only one with any programming knowledge, that task falls to me. Being a beginner programmer, I am not too sure of the limitations of small basic, but mostly I would like the game to feature these (by all means skip ahead if you don't care to read the following and would rather just answer my question) :

    1. Different unit stats. By far what makes strategy games good is the balance of Units on each team and i would like to know if it is possible to record different unit types in a single program, possibly in arrays?

    2. Graphics. This is more or less fluff that would be nice to have but is not necessary. What is the extent of the graphics Library?

    3. UI. How hard is it to program a screen that would let you view unit stats and other battle info that i currently can't think of?

    Now that the above background is out of the way, back to the original question. Can I make different libraries in the small basic language, and how would I go about doing this? All the libraries I've so far seen have been made in a more advanced language and then compiled for small basic. I would also like some info on the graphics capabilities of small basic please. I am hoping that I can convince my friends to learn small basic as well, I highly doubt that at my beginning stage I could get this game done by myself.

    Any help will be greatly appreciated, thanks!  

    Tuesday, May 11, 2010 1:33 AM

Answers

  • Burgerman,

    The answer to your question about libraries is No. 

    Although you can write libraries in smallbasic to use in smallbasic, you cannot write libraries in smallbasic that are more advanced than the commands already available in smallbasic.  That's why you have seen existing libraries being written in more advanced languages, in order to provide smallbasic with more advanced functionality.

    Question 1: Yes you could use arrays to store the values of different unit types, or any other data required by the strategy game. The data in the arrays would however be deleted once you exit your program; to keep the data, you would have to store it in a file on disk.

    Question 2: The graphics library in SmallBasic is very... well... basic.  It allows you to create Shapes that you can move around (like basic sprites), and it allows you to draw basic shapes (squares, circles, etc.) onto the drawing area which you cannot move around (i.e. they are fixed in place until you erase them). Of course, a lot of the fun of SmallBasic is being inventive within its limitations to see what great stuff you can come up with.

    Question 3: That depends on how graphical and interactive you would like your screen to be. Just displaying text is relatively easy, but creating clickable areas gets much more difficult.

    If you are looking for lots of interactivity and graphics, then you may be better off at the moment with something like PlayBasic or DarkBasic (search google). I'd have to see an example of what you're planning before I could give a more specific answer.

    Tuesday, May 11, 2010 8:21 PM

All replies

  • Yes, you can make custom libraries for SB. The easy way is to use Fremy's Small Basic Compiler (http://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/1a3f54f3-8412-40ff-a06b-08dc65a49530) or you could do it the hard way (http://blogs.msdn.com/smallbasic/archive/2008/10/27/extending-small-basic.aspx)
    -Phillip Mikesell
    Tuesday, May 11, 2010 3:33 AM
  • Burgerman,

    The answer to your question about libraries is No. 

    Although you can write libraries in smallbasic to use in smallbasic, you cannot write libraries in smallbasic that are more advanced than the commands already available in smallbasic.  That's why you have seen existing libraries being written in more advanced languages, in order to provide smallbasic with more advanced functionality.

    Question 1: Yes you could use arrays to store the values of different unit types, or any other data required by the strategy game. The data in the arrays would however be deleted once you exit your program; to keep the data, you would have to store it in a file on disk.

    Question 2: The graphics library in SmallBasic is very... well... basic.  It allows you to create Shapes that you can move around (like basic sprites), and it allows you to draw basic shapes (squares, circles, etc.) onto the drawing area which you cannot move around (i.e. they are fixed in place until you erase them). Of course, a lot of the fun of SmallBasic is being inventive within its limitations to see what great stuff you can come up with.

    Question 3: That depends on how graphical and interactive you would like your screen to be. Just displaying text is relatively easy, but creating clickable areas gets much more difficult.

    If you are looking for lots of interactivity and graphics, then you may be better off at the moment with something like PlayBasic or DarkBasic (search google). I'd have to see an example of what you're planning before I could give a more specific answer.

    Tuesday, May 11, 2010 8:21 PM
  • Davey,

    Thanks for the information. More or less i don't have any finalized plans for the game as of yet, so i really can't give any specifics.

    I have checked out PlayBasic and DarkBasic though and those look like they will work. Thanks for the tip! :)

     

    Wednesday, May 12, 2010 4:34 PM