Resolve conflicts, duration's back on the menu
25
.vscode/c_cpp_properties.json
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Win32",
|
||||||
|
"includePath": [
|
||||||
|
"${workspaceFolder}/**",
|
||||||
|
"C:\\Users\\gchri\\AppData\\Local\\.xmake\\packages\\r\\raylib\\5.5\\ff3f87ca824444c78f4ea6c42aea7e19\\include",
|
||||||
|
"C:\\Users\\gchri\\AppData\\Local\\.xmake\\packages\\b\\box2d\\v3.1.1\\c325728b2cd54c829f73cb36a64d56bf\\include",
|
||||||
|
"C:\\Users\\gchri\\AppData\\Local\\.xmake\\packages\\l\\ldtkloader\\1.5.3+1\\ac7d0c1a303c4f8cae45b3efe77ceb79\\include",
|
||||||
|
"C:\\Users\\gchri\\AppData\\Local\\.xmake\\packages\\r\\rapidjson\\2025.02.05\\5aec2755925a45d9974d95d2cb7038b1\\include"
|
||||||
|
],
|
||||||
|
"defines": [
|
||||||
|
"_DEBUG",
|
||||||
|
"UNICODE",
|
||||||
|
"_UNICODE"
|
||||||
|
],
|
||||||
|
"windowsSdkVersion": "10.0.26100.0",
|
||||||
|
"compilerPath": "cl.exe",
|
||||||
|
"cStandard": "c17",
|
||||||
|
"cppStandard": "c++17",
|
||||||
|
"intelliSenseMode": "windows-msvc-x64"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
@ -2,8 +2,8 @@
|
|||||||
"header": {
|
"header": {
|
||||||
"keySignatures": [],
|
"keySignatures": [],
|
||||||
"meta": [],
|
"meta": [],
|
||||||
"name": "Mary Had A Little Lamb",
|
"name": "Mary Had a Lil' Lamb",
|
||||||
"artist": "Mrs Mary",
|
"artist": "Mary J. Blige",
|
||||||
"ppq": 480,
|
"ppq": 480,
|
||||||
"tempos": [
|
"tempos": [
|
||||||
{
|
{
|
||||||
|
|||||||
6211
assets/songs/json/pallettown.json
Normal file
@ -15,6 +15,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "Tetris Theme",
|
"name": "Tetris Theme",
|
||||||
|
"artist": "Ivan the Terrible",
|
||||||
"ppq": 120,
|
"ppq": 120,
|
||||||
"tempos": [
|
"tempos": [
|
||||||
{
|
{
|
||||||
|
|||||||
73665
assets/songs/json/undertale.json
Normal file
60
py/README.md
@ -1,60 +0,0 @@
|
|||||||
# 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
|
|
||||||
```
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
from pydantic import BaseModel, ConfigDict
|
|
||||||
|
|
||||||
class Header(BaseModel):
|
|
||||||
model_config = ConfigDict(extra='ignore')
|
|
||||||
|
|
||||||
name: str
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
from pydantic import BaseModel, ConfigDict
|
|
||||||
|
|
||||||
class Instrument(BaseModel):
|
|
||||||
model_config = ConfigDict(extra='ignore')
|
|
||||||
|
|
||||||
family: str
|
|
||||||
number: int
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
from pydantic import BaseModel, ConfigDict, Field
|
|
||||||
|
|
||||||
class Note(BaseModel):
|
|
||||||
model_config = ConfigDict(extra='ignore')
|
|
||||||
|
|
||||||
duration_ticks: int = Field(alias='durationTicks')
|
|
||||||
midi: int
|
|
||||||
name: str
|
|
||||||
ticks: int
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
from header import Header
|
|
||||||
from pydantic import BaseModel, ConfigDict
|
|
||||||
from track import Track
|
|
||||||
|
|
||||||
class Song(BaseModel):
|
|
||||||
model_config = ConfigDict(extra='ignore')
|
|
||||||
|
|
||||||
header: Header
|
|
||||||
tracks: list[Track]
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
import json
|
|
||||||
import os
|
|
||||||
|
|
||||||
from song import Song
|
|
||||||
|
|
||||||
def load_song(song_file: str) -> Song:
|
|
||||||
print("load song:", song_file)
|
|
||||||
cd = os.getcwd()
|
|
||||||
print("current directory", cd)
|
|
||||||
with open(song_file, 'r') as f:
|
|
||||||
return Song(**json.load(f))
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
song = load_song('assets/music/json/tetris.json')
|
|
||||||
print(song)
|
|
||||||
raise SystemExit(0)
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
from instrument import Instrument
|
|
||||||
from note import Note
|
|
||||||
from pydantic import BaseModel, ConfigDict
|
|
||||||
|
|
||||||
class Track(BaseModel):
|
|
||||||
model_config = ConfigDict(extra='ignore')
|
|
||||||
|
|
||||||
instrument: Instrument
|
|
||||||
name: str
|
|
||||||
notes: list[Note]
|
|
||||||
|
Before Width: | Height: | Size: 521 B |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 252 B |
|
Before Width: | Height: | Size: 252 B |
|
Before Width: | Height: | Size: 254 B |
|
Before Width: | Height: | Size: 249 B |
|
Before Width: | Height: | Size: 258 B |
|
Before Width: | Height: | Size: 255 B |
|
Before Width: | Height: | Size: 254 B |
|
Before Width: | Height: | Size: 249 B |
|
Before Width: | Height: | Size: 242 B |
|
Before Width: | Height: | Size: 218 B |
|
Before Width: | Height: | Size: 234 B |
|
Before Width: | Height: | Size: 199 B |
|
Before Width: | Height: | Size: 197 B |
|
Before Width: | Height: | Size: 222 B |
|
Before Width: | Height: | Size: 224 B |
|
Before Width: | Height: | Size: 161 B |
|
Before Width: | Height: | Size: 146 B |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 253 B |
|
Before Width: | Height: | Size: 255 B |
|
Before Width: | Height: | Size: 244 B |
|
Before Width: | Height: | Size: 258 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |