Added basic game logic class

This commit is contained in:
duckduckdoof 2025-01-22 12:34:51 -05:00
parent be57a7a3ed
commit d2e217ae9f
3 changed files with 128 additions and 18 deletions

View file

@ -42,3 +42,25 @@ TEST_MAP = MAPS + "default-map.json"
# Layers for Map
LAYER_STRUCTURES = "Structures"
LAYER_ENVIRONMENT = "Environment"
# Tile Types
LOGGER = "LoggerTile"
CROPS = "CropsTile"
HYDROPOWER = "HydroPowerTile"
HOUSING = "HousingTile"
MINER = "MinerTile"
FACTORY = "FactoryTile"
JUNCTION = "JunctionTile"
GROUND = "GroundTile"
WATER = "WaterTile"
IRON = "IronTile"
TREES = "TreesTile"
# Game Starting Resources
STARTING_RESOURCES = {
"iron": 50,
"wood": 100,
"people": 10,
"food": 200
}

35
lib/game_logic.py Normal file
View file

@ -0,0 +1,35 @@
"""
game_logic.py
author: Caleb Scott
Internal logic for the game world.
"""
# IMPORTS -----------------------------------------------------------
import arcade
from game_config import *
# CLASSES -----------------------------------------------------------
class GameLogic:
def __init__(self, scene, starting_resources):
# Initializes the game board (from arcade Scene)
# and starting resources
self.scene = scene
self.resources = starting_resources
def place_structure(self, x, y):
"""
Game logic for placing a structure, if valid.
"""
pass
def delete_structure(self, x, y):
"""
Game logic for deleting a structure, if valid.
"""
pass