Browse Source

Add Mice! game and associated tools

- Created gameinfo.xml for the Mice! game, detailing its description, release date, developer, and genre.
- Added mice.sh script to activate the conda environment and run the game.
- Implemented colorize_assets.py as a placeholder for future asset colorization functionality.
- Developed convert_audio.py to convert audio files to 8-bit unsigned format at 22100 Hz.
- Introduced maze.py for generating mazes using Depth First Search (DFS) with a graphical interface.
- Created resize_assets.py to resize PNG assets to 18x18 pixels and center them on a 20x20 canvas.
master
Matteo Benedetto 7 months ago
parent
commit
3bd2d9269f
  1. BIN
      cover.jpg
  2. BIN
      cover.png
  3. 14
      gameinfo.xml
  4. 7
      mice.sh
  5. 23
      rats.py
  6. BIN
      rats.wasm
  7. 0
      tools/colorize_assets.py
  8. 0
      tools/convert_audio.py
  9. 0
      tools/maze.py
  10. 0
      tools/resize_assets.py

BIN
cover.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

BIN
cover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

14
gameinfo.xml

@ -0,0 +1,14 @@
<?xml version='1.0' encoding='utf-8'?>
<gameList>
<game>
<path>./mice.sh</path>
<name>Mice!</name>
<desc>Mice! is a strategic single‑player game where you place bombs and mines to exterminate rats before they reproduce out of control. It features randomly generated mazes (DFS), sprite-based graphics, and sound effects. Inspired by the classic Rats! for Windows 95, this version is written in Python and uses a lightweight custom engine with SDL‑style rendering.</desc>
<releasedate>20250818T000000</releasedate>
<developer>Matteo Benedetto</developer>
<publisher>Self-published</publisher>
<genre>Strategy, Puzzle, Action</genre>
<players>1</players>
<image>./cover.png</image>
</game>
</gameList>

7
mice.sh

@ -0,0 +1,7 @@
#!/bin/sh
eval "$(/home/ark/miniconda3/bin/conda shell.bash hook)"
conda activate myenv
cd /roms/ports/mice/
#git pull
python rats.py
sleep 3

23
rats.py

@ -38,6 +38,17 @@ class MiceMaze(
self.start_game()
self.background_texture = None
self.configs = self.get_config()
def get_config(self):
configs = {}
for file in os.listdir("conf"):
if file.endswith(".json"):
with open(os.path.join("conf", file)) as f:
configs[file[:-5]] = json.load(f)
return configs
def start_game(self):
self.ammo = {
"bomb": {
"count": 2,
@ -52,16 +63,6 @@ class MiceMaze(
"max": 5
}
}
def get_config(self):
configs = {}
for file in os.listdir("conf"):
if file.endswith(".json"):
with open(os.path.join("conf", file)) as f:
configs[file[:-5]] = json.load(f)
return configs
def start_game(self):
self.blood_stains = {}
self.background_texture = None
for _ in range(5):
@ -140,7 +141,7 @@ class MiceMaze(
if __name__ == "__main__":
print("Game starting...")
solver = MiceMaze('maze.json')
solver.run()

BIN
rats.wasm

Binary file not shown.

0
colorize_assets.py → tools/colorize_assets.py

0
convert_audio.py → tools/convert_audio.py

0
maze.py → tools/maze.py

0
resize_assets.py → tools/resize_assets.py

Loading…
Cancel
Save