Merge branch 'main' into master

This commit is contained in:
Caleb Scott 2025-01-21 16:50:20 -05:00 committed by GitHub
commit f02fbfbf3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 238 additions and 1 deletions

View file

@ -13,4 +13,3 @@ This project uses:
* [Python Arcade](https://api.arcade.academy/en/latest/index.html) as the game engine (instead of PyGame)
* [Tiled](https://www.mapeditor.org/) for tilemapping
* [Aseprite](https://www.aseprite.org/) for tiles/textures.

28
maps/bulidings.tsx Normal file
View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.10" tiledversion="1.11.1" name="bulidings" tilewidth="32" tileheight="32" tilecount="8" columns="0">
<grid orientation="orthogonal" width="1" height="1"/>
<tile id="0" type="LoggerTile">
<image source="../res/logger.png" width="32" height="32"/>
</tile>
<tile id="1" type="PowerPoleTile">
<image source="../res/powerpole.png" width="32" height="32"/>
</tile>
<tile id="2" type="CropsTile">
<image source="../res/crops.png" width="32" height="32"/>
</tile>
<tile id="3" type="HydroPowerTile">
<image source="../res/hydropower.png" width="32" height="32"/>
</tile>
<tile id="4" type="HousingTile">
<image source="../res/housing.png" width="32" height="32"/>
</tile>
<tile id="5" type="MinerTile">
<image source="../res/miner.png" width="32" height="32"/>
</tile>
<tile id="6" type="FactoryTile">
<image source="../res/factory.png" width="32" height="32"/>
</tile>
<tile id="7" type="connector">
<image source="../res/connector.png" width="32" height="32"/>
</tile>
</tileset>

View file

@ -0,0 +1,14 @@
{
"automappingRulesFile": "",
"commands": [
],
"compatibilityVersion": 1100,
"extensionsPath": "extensions",
"folders": [
"."
],
"properties": [
],
"propertyTypes": [
]
}

View file

@ -0,0 +1,29 @@
{
"Map/SizeTest": {
"height": 4300,
"width": 2
},
"activeFile": "",
"expandedProjectPaths": [
],
"fileStates": {
"bulidings.tsx": {
"dynamicWrapping": true
},
"world-tiles.tsx": {
"dynamicWrapping": false
}
},
"last.exportedFilePath": "/home/goose/dev/mycropolis_game/my-sim-game/maps",
"last.imagePath": "/home/goose/dev/mycropolis_game/my-sim-game/res",
"map.lastUsedExportFilter": "All Files (*)",
"map.lastUsedFormat": "tmx",
"map.renderOrder": "1",
"openFiles": [
],
"project": "colony-sim.tiled-project",
"recentFiles": [
],
"tileset.lastUsedFormat": "tsx",
"tileset.type": 1
}

56
maps/default-map.tmx Normal file
View file

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.11.1" orientation="orthogonal" renderorder="right-up" width="30" height="20" tilewidth="32" tileheight="32" infinite="0" nextlayerid="12" nextobjectid="3">
<editorsettings>
<export target="default-map.json" format="json"/>
</editorsettings>
<tileset firstgid="1" source="world-tiles.tsx"/>
<tileset firstgid="5" source="bulidings.tsx"/>
<layer id="1" name="Environment" width="30" height="20">
<data encoding="csv">
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
3,3,3,4,4,4,4,4,4,4,4,4,4,4,3,4,2,4,4,4,4,4,4,4,4,4,4,4,3,3,
3,3,4,4,4,4,4,4,4,4,4,4,4,4,3,4,2,2,2,4,4,4,4,4,4,2,2,4,3,3,
3,4,4,4,4,4,4,4,4,4,4,2,4,4,3,4,4,4,4,4,4,4,4,4,2,2,2,4,4,3,
3,4,1,1,4,4,2,4,4,4,4,4,2,4,3,4,4,4,4,4,4,4,4,4,2,2,2,4,4,3,
3,4,1,1,4,4,2,4,4,4,4,4,4,4,3,4,4,4,4,2,4,4,4,4,2,2,2,4,4,3,
3,4,4,4,4,4,4,2,4,4,4,4,4,4,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,
3,4,4,4,4,4,4,2,4,4,4,2,2,4,3,4,4,4,4,2,4,4,4,4,4,4,4,4,3,3,
3,3,4,4,4,4,4,4,4,4,2,2,4,4,3,3,4,4,4,4,4,4,4,1,1,1,1,4,3,3,
3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,3,3,4,2,4,4,4,4,4,4,4,4,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,12,12,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,12,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,8,12,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
</map>

16
maps/world-tiles.tsx Normal file
View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.10" tiledversion="1.11.1" name="world-tiles" tilewidth="32" tileheight="32" tilecount="4" columns="0">
<grid orientation="orthogonal" width="1" height="1"/>
<tile id="0" type="IronTile">
<image source="../res/iron.png" width="32" height="32"/>
</tile>
<tile id="1" type="TreesTile">
<image source="../res/trees.png" width="32" height="32"/>
</tile>
<tile id="2" type="WaterTile">
<image source="../res/water.png" width="32" height="32"/>
</tile>
<tile id="3" type="GroundTile">
<image source="../res/ground.png" width="32" height="32"/>
</tile>
</tileset>

BIN
res/connector.aseprite Normal file

Binary file not shown.

BIN
res/crops.aseprite Normal file

Binary file not shown.

BIN
res/factory.aseprite Normal file

Binary file not shown.

BIN
res/ground.aseprite Normal file

Binary file not shown.

BIN
res/housing.aseprite Normal file

Binary file not shown.

BIN
res/hydropower.aseprite Normal file

Binary file not shown.

BIN
res/iron.aseprite Normal file

Binary file not shown.

BIN
res/logger.aseprite Normal file

Binary file not shown.

BIN
res/miner.aseprite Normal file

Binary file not shown.

BIN
res/powerpole.aseprite Normal file

Binary file not shown.

BIN
res/trees.aseprite Normal file

Binary file not shown.

BIN
res/water.aseprite Normal file

Binary file not shown.

16
template.py Normal file
View file

@ -0,0 +1,16 @@
"""
template.py
author: Caleb Scott
Template file for arcade program.
"""
# IMPORTS -----------------------------------------------------------
# CONSTANTS ---------------------------------------------------------
# CLASSES -----------------------------------------------------------
# MAIN --------------------------------------------------------------

79
test-demo.py Normal file
View file

@ -0,0 +1,79 @@
"""
test-demo.py
author: Caleb Scott
This is basically just a test-class to get my "sea legs" for Arcade.
"""
# IMPORTS -----------------------------------------------------------
import arcade
import os
# CONSTANTS ---------------------------------------------------------
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
SCREEN_TITLE = "Test Demo with Arcade"
# CLASSES -----------------------------------------------------------
class GameBoard(arcade.Window):
"""
Main app class
"""
def __init__(self, width, height, title):
super().__init__(width, height, title)
arcade.set_background_color(arcade.color.AMAZON)
def setup(self):
"""
Used for initializing game objects, etc.
"""
pass
def on_draw(self):
"""
Main rendering function
"""
self.clear()
def on_update(self, delta_time):
"""
Updates/movements/game logic
"""
pass
def on_key_press(self, key, modifiers):
"""
Handling keypresses
"""
if key == arcade.key.UP:
print("Key press: UP")
elif key == arcade.key.DOWN:
print("Key press: DOWN")
else:
print("Some other key pressed...")
def on_key_release(self, key, modifiers):
"""
Handling key releases
"""
if key == arcade.key.UP:
print("Key release: UP")
elif key == arcade.key.DOWN:
print("Key release: DOWN")
else:
print("Some other key released...")
# MAIN --------------------------------------------------------------
def main():
window = GameBoard(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
window.setup()
arcade.run()
if __name__ == "__main__":
main()