mirror of
https://github.com/duckduckdoof/miniopolis.git
synced 2025-09-06 21:25:50 -04:00
Added basic game logic class
This commit is contained in:
parent
be57a7a3ed
commit
d2e217ae9f
3 changed files with 128 additions and 18 deletions
|
@ -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
35
lib/game_logic.py
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue