Crate game_logic[−][src]
Expand description
This file is the main entry point for the game logic.
Overview
The main function in this module is entrypoint()
. This is called from desktop_wrapper
to start the game.
This module also includes all the other sub-modules of the game. If you are viewing this document from the web, click on the modules below to see more info.
Programming Guide
The game code is split into two parts: the core code, and the actual game logic.
@ewpratten has written most of the core code to bootstrap the game, and provide convenience functions.
This stuff probably won’t need to be touched.
Most of the game logic is expected to live in src/scenes
and src/model
(rendering and data).
Important Functions and Files
- If you are wanting to write rendering code, check out
process_ingame_frame
. - If you want to have something load at the start of the game and stay in memory, check out
GlobalResources
. - If you want to add data to the save state file or settings file, check out the
persistent
module.
Modules
Embedded asset management.
Interfacing with Discord
Global resources
This module contains the datastructure backing persistent data.
The rust side of the dist/project-constants.json
file
This module contains lower level rendering logic.
The render code for various scenes
Functions
This is the game logic entrypoint. Despite being async, this is expected to block the main thread for rendering and stuff.