From f993cccf1f371057e87b0da39ef92e0f9ca22c83 Mon Sep 17 00:00:00 2001 From: duckduckdoof Date: Tue, 4 Feb 2025 14:43:54 -0500 Subject: [PATCH] Separated scene logic from game logic --- lib/engine/game_config.py | 10 ++++++++++ lib/{ => engine}/game_logic.py | 7 ++++--- lib/{game_config.py => scene/scene_config.py} | 7 ++++--- lib/{tiles.py => scene/scene_tiles.py} | 4 ++-- miniopolis.py | 4 ++-- 5 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 lib/engine/game_config.py rename lib/{ => engine}/game_logic.py (95%) rename lib/{game_config.py => scene/scene_config.py} (85%) rename lib/{tiles.py => scene/scene_tiles.py} (97%) diff --git a/lib/engine/game_config.py b/lib/engine/game_config.py new file mode 100644 index 0000000..781414d --- /dev/null +++ b/lib/engine/game_config.py @@ -0,0 +1,10 @@ +""" +game_config.py + +author: Caleb Scott + +Configuration file for game objects (like setting default rates, types, etc.). +This is not the same as scene_config.py, which configures the scene (visuals, sprites, etc.). +""" + +# CONSTANTS --------------------------------------------------------- \ No newline at end of file diff --git a/lib/game_logic.py b/lib/engine/game_logic.py similarity index 95% rename from lib/game_logic.py rename to lib/engine/game_logic.py index 7ab733f..e82d361 100644 --- a/lib/game_logic.py +++ b/lib/engine/game_logic.py @@ -3,14 +3,15 @@ game_logic.py author: Caleb Scott -Internal logic for the game world. +Internal logic for the game world. This doesn't work with setting +visual elements; this is handles in the scene/ python files """ # IMPORTS ----------------------------------------------------------- import arcade -from lib.game_config import * -from lib.tiles import * +from lib.scene.scene_config import * +from lib.scene.scene_tiles import * # CLASSES ----------------------------------------------------------- diff --git a/lib/game_config.py b/lib/scene/scene_config.py similarity index 85% rename from lib/game_config.py rename to lib/scene/scene_config.py index 1e3ddc6..235004c 100644 --- a/lib/game_config.py +++ b/lib/scene/scene_config.py @@ -1,10 +1,11 @@ - """ -game_config.py +scene_config.py author: Caleb Scott -Contains all constants needed to modify the game +Configuration file for modifying the visual scene of the game. +This is not the same as game_config.py, which is used to adjust +game objects (apart from their visuals, like sprites) """ # CONSTANTS --------------------------------------------------------- diff --git a/lib/tiles.py b/lib/scene/scene_tiles.py similarity index 97% rename from lib/tiles.py rename to lib/scene/scene_tiles.py index 479834e..b4ce7c7 100644 --- a/lib/tiles.py +++ b/lib/scene/scene_tiles.py @@ -1,5 +1,5 @@ """ -tiles.py +scene_tiles.py author: Caleb Scott @@ -9,7 +9,7 @@ Contains all classes of tiles used in miniopolis # IMPORTS ----------------------------------------------------------- import arcade -from lib.game_config import * +from lib.scene.scene_config import * # CLASSES ----------------------------------------------------------- diff --git a/miniopolis.py b/miniopolis.py index 22000e6..7fd0e34 100644 --- a/miniopolis.py +++ b/miniopolis.py @@ -10,8 +10,8 @@ First attempt to make a tile-based colony-sim game. import arcade -from lib.game_config import * -from lib.game_logic import GameLogic +from lib.scene.scene_config import * +from lib.engine.game_logic import GameLogic # CLASSES -----------------------------------------------------------