Jump to content
IGNORED

Make a Build using INCLUDE


TR4SHD4T4

Recommended Posts

I have no code as an example because I don't want to frustrate myself doing things that can't be done.

My question is... can I make my original .BAS file essentially a build file for the type of game I want to play.

For Instance: I can have a 1 player game, if it is a one player game a variety of "artificial intellects", or a two player game

If One Player easy then INCLUDE "oneplayereasy.bas"
If One Player Hard then INCLUDE "oneplayerhard.bas"
If Twoplaye then INCLUDE "TwoPlayer.bas"

In this way, I can have the main file build a game without excessive code that is specific to that execution of the program.

*shrugs*

Link to comment
Share on other sites

One trick I've used with AS1600 is to abuse the "include path" to point it to different directories to get different build configurations.  You could do something similar with IntyBASIC's library_path argument.

 

  • Make a directory for each of your game configurations, e.g. cfg_1up_easy, cfg_1up_hard, cfg_2up.
  • Copy intybasic_prologue.asm and intybasic_epilogue.asm into all of them, since it appears IntyBASIC only searches one directory.  (Someone correct me if that's not true.)
  • Add a .bas file in each that holds the configuration-specific details.  (Note: This can INCLUDE other files!)  For example, name it game_config.bas.
  • In your main game source file, simply INCLUDE "game_config.bas" (or whatever name you chose).
  • When you compile the game pick the configuration by specifying one of the directories created above as the library_path.  The following will compile the three versions to three separate assembly files:
    • intybasic --title "My Game (1up Easy)" mygame.bas mygame_1up_easy.asm cfg_1up_easy
    • intybasic --title "My Game (1up Hard)" mygame.bas mygame_1up_hard.asm cfg_1up_hard
    • intybasic --title "My Game (2up)" mygame.bas mygame_2up_hard.asm cfg_2up

Then, assemble these as usual.

 

You could fold the details into separate scripts/batch files, so you can run, say, build_1up_hard to just build that variant.

 

As I said, I've used this to build variants with different features (debug code, cheats, etc.) w/ AS1600 and its -i dir flag. I see no reason why a similar trick couldn't work with IntyBASIC.

  • Like 3
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...