Updated submodule, hopefully clicks and pops are gone once and for all. Added dialogue system for levels that mave more than just a simple 1 line description.
This commit is contained in:
@@ -36,6 +36,53 @@ Every level needs these essential properties:
|
||||
|
||||
If you set `locked` to `true`, the player cannot leave the level until all enemies have been defeated. Drop custom ambience files (e.g., music or creepy soundtracks) in `sounds/ambience/`. Add custom footstep sounds into the `sounds/` directory.
|
||||
|
||||
### Dialogue System
|
||||
|
||||
Instead of using a simple `"description"` field, levels can now include interactive dialogue sequences with the new `"dialog"` property. This creates immersive story-driven introductions with character conversations:
|
||||
|
||||
```json
|
||||
{
|
||||
"level_id": 1,
|
||||
"name": "Story Level",
|
||||
"dialog": {
|
||||
"allow_skip": true,
|
||||
"entries": [
|
||||
{
|
||||
"speaker": "Character Name",
|
||||
"text": "This is what the character says."
|
||||
},
|
||||
{
|
||||
"speaker": "Billy Bones",
|
||||
"text": "This is the player character's response."
|
||||
},
|
||||
{
|
||||
"text": "A narrative description of what happens.",
|
||||
"narrative": true
|
||||
},
|
||||
{
|
||||
"speaker": "Character Name",
|
||||
"text": "More dialogue with optional sound effect.",
|
||||
"sound": "character_sound"
|
||||
}
|
||||
]
|
||||
},
|
||||
"player_start": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Dialogue Properties:**
|
||||
- `allow_skip`: Set to `true` to let players skip the dialogue sequence
|
||||
- `entries`: Array of dialogue entries that play in sequence
|
||||
- `speaker`: Name of the character speaking (optional for narrative entries)
|
||||
- `text`: The dialogue text to be spoken
|
||||
- `narrative`: Set to `true` for descriptive text entries (no speaker)
|
||||
- `sound`: Optional sound file to play with this dialogue entry. If no sound is specified, the system will automatically play `sounds/dialogue.ogg` if it exists.
|
||||
|
||||
**Note:** Levels can use either `"description"` (traditional format) or `"dialog"` (new interactive format), but not both. The dialogue system takes precedence if both are present.
|
||||
|
||||
## Adding Objects
|
||||
|
||||
All objects go in an `"objects"` list. Here are examples of what you can add:
|
||||
@@ -354,7 +401,34 @@ Here's a comprehensive example showing multiple advanced features:
|
||||
{
|
||||
"level_id": 5,
|
||||
"name": "The Witch's Domain",
|
||||
"description": "Dark magic fills the air as you approach the witch's lair. Beware her minions and the cursed ground beneath your feet.",
|
||||
"dialog": {
|
||||
"allow_skip": true,
|
||||
"entries": [
|
||||
{
|
||||
"speaker": "Ancient Spirit",
|
||||
"text": "Mortal skeleton, you dare enter the witch's sacred domain?",
|
||||
"sound": "ancient_spirit"
|
||||
},
|
||||
{
|
||||
"speaker": "Billy Bones",
|
||||
"text": "I'm looking for trouble, and I think I found it."
|
||||
},
|
||||
{
|
||||
"text": "The air grows thick with dark magic as ancient runes begin to glow.",
|
||||
"narrative": true,
|
||||
"sound": "magic_ambience"
|
||||
},
|
||||
{
|
||||
"speaker": "Ancient Spirit",
|
||||
"text": "Then face the consequences of your boldness. The witch's minions will not show mercy.",
|
||||
"sound": "evil_laughter"
|
||||
},
|
||||
{
|
||||
"speaker": "Billy Bones",
|
||||
"text": "Good thing I don't need any."
|
||||
}
|
||||
]
|
||||
},
|
||||
"locked": true,
|
||||
"player_start": {"x": 0, "y": 0},
|
||||
"boundaries": {"left": 0, "right": 300},
|
||||
|
Submodule libstormgames updated: 8c57afe65b...a98783dbc4
BIN
sounds/dialogue.ogg
(Stored with Git LFS)
Normal file
BIN
sounds/dialogue.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
Reference in New Issue
Block a user