diff --git a/tile-demo.py b/miniopolis.py similarity index 78% rename from tile-demo.py rename to miniopolis.py index 70c426e..4e4650c 100644 --- a/tile-demo.py +++ b/miniopolis.py @@ -1,57 +1,18 @@ - """ -tile-demo.py +miniopolis.py author: Caleb Scott -Attempting to make a tile-based layout for a colony-sim game. +First attempt to make a tile-based colony-sim game. """ # IMPORTS ----------------------------------------------------------- import arcade - -# CONSTANTS --------------------------------------------------------- - -# Sizing -TILE_SCALE = 1.0 - -# Screen constants -SCREEN_WIDTH = 960 -SCREEN_HEIGHT = 960 -SCREEN_TITLE = "ColonySim Tiles Demo" - -# World size -WORLD_WIDTH = 960 -WORLD_HEIGHT = 640 - -# Text placement -TEXT_X = 10 -TEXT_Y = SCREEN_HEIGHT - 30 -TEXT_Y_WIDTH = 30 - -# Resources dir -RES = "res/" - -# Maps dir + map presets -MAPS = "maps/" -TEST_MAP = MAPS + "default-map.json" - -# Layers for Map -LAYER_STRUCTURES = "Structures" -LAYER_ENVIRONMENT = "Environment" +from lib.game_config import * # CLASSES ----------------------------------------------------------- -class HousingTile(arcade.Sprite): - - def __init__(self): - # Basic type attributes - self.type = "Housing" - - self.image_file_name = RES + "housing.png" - super().__init__(self.image_file_name, TILE_SCALE) - class GameBoard(arcade.Window): def __init__(self, width, height, title): @@ -95,7 +56,7 @@ class GameBoard(arcade.Window): start_x=TEXT_X, start_y=TEXT_Y - TEXT_Y_WIDTH ) self.resources_text = arcade.Text( - "RESOURCES: People: 0, Iron: 0, Wood: 0, Crops: 0", + "RESOURCES: People: 0, Iron: 0, Wood: 0, Food: 0", start_x=TEXT_X, start_y=TEXT_Y - 2*TEXT_Y_WIDTH ) self.tile_text = arcade.Text( @@ -135,11 +96,13 @@ class GameBoard(arcade.Window): # Draw updated text self.structs_text.draw() self.commands_text.draw() - self.resources_text.draw() self.tile_text.text = f"SELECTED: {self.selected_struct_tile} on {self.selected_env_tile}" self.tile_text.draw() + self.resources_text.text = f"RESOURCES: People: 0, Iron: 0, Wood: 0, Food: 0", + self.resources_text.draw() + # MAIN -------------------------------------------------------------- def main(): diff --git a/template.py b/template.py index 0bce1ef..4e13c24 100644 --- a/template.py +++ b/template.py @@ -1,4 +1,3 @@ - """ template.py