Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hello,

Good questions.

Firstly, overlays of graphics are most certainly in the roadmap for Adventuron but they won't be ready in the timescale of this jam.

You are correct that set_graphic can be used to change the image to do with a scene, and that is the easiest way to switch state right now (without overlays), but yes, if you have a lot of elements they can become burdonsome.

Now, it really depends on if you are targetting 8-bit as to if you can use what I am recommending from this point forward. For 8-bit games, you certainly cannot use these features. If you are not targetting 8-bit then read on ....

Feature 1 - link graphics as external files (not 8-bit mode compatible):

You can reference graphics in external files. Graphics can be referenced by direct url or by relative reference. If you have web space somewhere, it's easier when developing to reference a http or https address (as your images will not be available on the adventuron classroom server).

Before you upload your finished game to itch, you should change these urls to a relative path (see the sample code at the bottom). When you deploy to itch, make a zipfile of your html file, and all your graphic assets together, and then the main game will reference relative to the outer html file.

https://adventuron.io/documentation/cookbook.html#LinkingExternalMedia

Feature 2 - Dynamic graphics (not 8-bit mode compatible):

You can use dynamic graphics to create rules for selecting graphics. If you have 3 dynamic elements of your location graphic that are either on or off, then the number of images you'd need to supply would be 8. It's bothersome, but it's doable, and not too much extra work. Overlays will make this a LOT easier but they won't be ready.

https://adventuron.io/documentation/cookbook.html#DynamicGraphics

Feature 3 - Precache graphic (not 8-bit mode compatible):

Referencing graphics that are not embedded in the html file can lead to pop-in, as there will be a slight delay as the graphics are asynchronously accessed via the internet. To eliminate this pop-in, you can tell Adventuruon to pre-load all linked resources with the following configuration setting (at top level):

game_settings {
   precache_strategy = precache_all
}


------

Full sample
game_settings {
   precache_strategy = precache_all
} assets {    graphics {       // Contains the rule of which graphic to choose (returns a string id of the graphic to pick)
      // boolean_expression ? when_true : when_false       hallway : dynamic_graphic {(
         is_hallway_lit ? (is_hallway_door_open ? "hallway_lit_door_open" : "hallway_lit_door_closed")
         : (is_hallway_door_open ? "hallway_unlit_door_open" : "hallway_unlit_door_closed")
      )}       hallway_lit_door_open : png "images/hallway_lit_door_open.png";
      hallway_lit_door_closed : png "images/hallway_lit_door_closed.png";
      hallway_unlit_door_open : png "images/hallway_unlit_door_open.png";
      hallway_unlit_door_closed : png "images/hallway_unlit_door_closed.png";
   } }


Regards,

Chris