Python code
60
py/README.md
Normal file
@ -0,0 +1,60 @@
|
||||
# Game Jam Kit
|
||||
A simple framework for making small games with [raylib](https://www.raylib.com/), [box2d](https://box2d.org/), and [LDtk](https://ldtk.io/).
|
||||
|
||||
Python version of the [C++ Game Jam Kit](https://github.com/davabase/game_jam_kit).
|
||||
|
||||
## Introduction
|
||||
The framework in setup as a series of classes that manage the lifecycle of each other.
|
||||
|
||||
`Game` manages `Manager`s and `Scene`s.
|
||||
|
||||
A `Manager` holds resources that are used across scenes. The resources are loaded at `Game::init()`.
|
||||
|
||||
`Scene` manages `Service`s and `GameObject`s.
|
||||
|
||||
`Scene`s also perform game logic for each level.
|
||||
|
||||
A `Service` holds resources that are used in a single scene. The resources are loaded during init and disposed when the scene is disposed.
|
||||
|
||||
`GameObject` manages `Component`s
|
||||
|
||||
`GameObject`s also perform game logic for individual game entities.
|
||||
|
||||
A `Component` is a reusable tool for creating `GameObject` behavior.
|
||||
|
||||
Each of these pieces has lifecycle functions for `init()`, `update()`, and `draw()` that can be overridden when creating your own subclasses. These functions are called by the containing manager. If you do not wish for your class to be managed you shouldn't inherit from these base classes.
|
||||
|
||||
The managers also have larger overridable functions, `init_*()`, `update_*()`, and `draw_*()` that give you increased control over how the manager is used.
|
||||
|
||||
See `engine/prefabs` for prebuilt managers, services, game objects, and components.
|
||||
|
||||
See `samples` for examples on how to build a `Scene`.
|
||||
|
||||
See `main.py` for how to build a `Game`.
|
||||
|
||||
## Running
|
||||
Create a python 3 venv:
|
||||
```
|
||||
python -m venv venv
|
||||
```
|
||||
|
||||
Initialize it:
|
||||
|
||||
on Windows:
|
||||
```
|
||||
venv\Scripts\activate
|
||||
```
|
||||
on the other ones:
|
||||
```
|
||||
source venv/bin/activate
|
||||
```
|
||||
|
||||
Install requirements:
|
||||
```
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
Run the main file:
|
||||
```
|
||||
python main.py
|
||||
```
|
||||
BIN
py/assets/fonts/Roboto.ttf
Normal file
BIN
py/assets/fonts/RobotoMono.ttf
Normal file
BIN
py/assets/fonts/Tiny5.ttf
Normal file
2212
py/assets/gamecontrollerdb.txt
Normal file
5571
py/assets/levels/collecting.ldtk
Normal file
1622
py/assets/levels/fighting.ldtk
Normal file
2651
py/assets/levels/top_down.ldtk
Normal file
BIN
py/assets/pixel_platformer/backgrounds.png
Normal file
|
After Width: | Height: | Size: 521 B |
BIN
py/assets/pixel_platformer/characters.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
py/assets/pixel_platformer/characters/blue_1.png
Normal file
|
After Width: | Height: | Size: 252 B |
BIN
py/assets/pixel_platformer/characters/blue_2.png
Normal file
|
After Width: | Height: | Size: 252 B |
BIN
py/assets/pixel_platformer/characters/green_1.png
Normal file
|
After Width: | Height: | Size: 254 B |
BIN
py/assets/pixel_platformer/characters/green_2.png
Normal file
|
After Width: | Height: | Size: 249 B |
BIN
py/assets/pixel_platformer/characters/pink_1.png
Normal file
|
After Width: | Height: | Size: 258 B |
BIN
py/assets/pixel_platformer/characters/pink_2.png
Normal file
|
After Width: | Height: | Size: 255 B |
BIN
py/assets/pixel_platformer/characters/yellow_1.png
Normal file
|
After Width: | Height: | Size: 254 B |
BIN
py/assets/pixel_platformer/characters/yellow_2.png
Normal file
|
After Width: | Height: | Size: 249 B |
BIN
py/assets/pixel_platformer/enemies/bat_1.png
Normal file
|
After Width: | Height: | Size: 242 B |
BIN
py/assets/pixel_platformer/enemies/bat_2.png
Normal file
|
After Width: | Height: | Size: 218 B |
BIN
py/assets/pixel_platformer/enemies/bat_3.png
Normal file
|
After Width: | Height: | Size: 234 B |
BIN
py/assets/pixel_platformer/enemies/block_head_1.png
Normal file
|
After Width: | Height: | Size: 199 B |
BIN
py/assets/pixel_platformer/enemies/block_head_2.png
Normal file
|
After Width: | Height: | Size: 197 B |
BIN
py/assets/pixel_platformer/enemies/drill_head_1.png
Normal file
|
After Width: | Height: | Size: 222 B |
BIN
py/assets/pixel_platformer/enemies/drill_head_2.png
Normal file
|
After Width: | Height: | Size: 224 B |
BIN
py/assets/pixel_platformer/items/coin_1.png
Normal file
|
After Width: | Height: | Size: 161 B |
BIN
py/assets/pixel_platformer/items/coin_2.png
Normal file
|
After Width: | Height: | Size: 146 B |
BIN
py/assets/pixel_platformer/tilemap.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
py/assets/sounds/coin.wav
Normal file
BIN
py/assets/sounds/die.wav
Normal file
BIN
py/assets/sounds/hit.wav
Normal file
BIN
py/assets/sounds/jump.wav
Normal file
BIN
py/assets/sounds/shoot.wav
Normal file
BIN
py/assets/sunnyland/back.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
py/assets/sunnyland/bunny/idle-1.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/bunny/idle-2.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/bunny/idle-3.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/bunny/idle-4.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/bunny/jump-1.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
py/assets/sunnyland/bunny/jump-2.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
py/assets/sunnyland/bunny/run-1.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
py/assets/sunnyland/bunny/run-2.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/bunny/run-3.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/bunny/run-4.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/bunny/run-5.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/bunny/run-6.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/fireball/fireball-1.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
py/assets/sunnyland/fireball/fireball-2.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
py/assets/sunnyland/fireball/fireball-3.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
py/assets/sunnyland/fireball/fireball-4.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
py/assets/sunnyland/fireball/fireball-5.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
py/assets/sunnyland/fireball/fireball-hit-1.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
py/assets/sunnyland/fireball/fireball-hit-2.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
py/assets/sunnyland/fireball/fireball-hit-3.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/fireball/fireball-hit-4.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
py/assets/sunnyland/fireball/fireball-hit-5.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
py/assets/sunnyland/fireball/fireball-hit-6.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
py/assets/sunnyland/fox/hurt-1.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
py/assets/sunnyland/fox/hurt-2.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
py/assets/sunnyland/fox/idle-1.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
py/assets/sunnyland/fox/idle-2.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
py/assets/sunnyland/fox/idle-3.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
py/assets/sunnyland/fox/idle-4.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
py/assets/sunnyland/fox/jump-1.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
py/assets/sunnyland/fox/jump-2.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
py/assets/sunnyland/fox/roll-1.png
Normal file
|
After Width: | Height: | Size: 253 B |
BIN
py/assets/sunnyland/fox/roll-2.png
Normal file
|
After Width: | Height: | Size: 255 B |
BIN
py/assets/sunnyland/fox/roll-3.png
Normal file
|
After Width: | Height: | Size: 244 B |
BIN
py/assets/sunnyland/fox/roll-4.png
Normal file
|
After Width: | Height: | Size: 258 B |
BIN
py/assets/sunnyland/fox/run-1.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
py/assets/sunnyland/fox/run-2.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
py/assets/sunnyland/fox/run-3.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
py/assets/sunnyland/fox/run-4.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
py/assets/sunnyland/fox/run-5.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
py/assets/sunnyland/fox/run-6.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
py/assets/sunnyland/imp/hurt-1.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/imp/hurt-2.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/imp/idle-1.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/imp/idle-2.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/imp/idle-3.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/imp/idle-4.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/imp/jump-1.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/imp/jump-2.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/imp/jump-3.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/imp/jump-4.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/imp/jump-5.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/imp/run-1.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/imp/run-2.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/imp/run-3.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/imp/run-4.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/imp/run-5.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/imp/run-6.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/imp/run-7.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/imp/run-8.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/imp/shot-1.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
py/assets/sunnyland/imp/shot-2.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/imp/shot-3.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/imp/shot-4.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
py/assets/sunnyland/middle.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
py/assets/sunnyland/squirrel/hurt-1.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |