Skip to content

Commit

Permalink
Show how a simple game is displayed in README.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
RowDaBoat committed Jun 24, 2024
1 parent 6f076e2 commit 4dc4bc5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
38 changes: 32 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@

## Index

- Introduction
- [Getting Started](doc/getting-started.md)
- [Items](doc/items.md)
- [Characters](doc/characters.md)
- [Dialogue Graphs](doc/dialogue-graphs.md)
- [Actions and Events](doc/actions-and-events.md)
- [Getting Started](doc/getting-started.md)
- [Items](doc/items.md)
- [Characters](doc/characters.md)
- [Dialogue Graphs](doc/dialogue-graphs.md)
- [Actions and Events](doc/actions-and-events.md)

## Setup

Expand Down Expand Up @@ -62,3 +61,30 @@ fun main() {
}
}
```

The game displays the following when run:
```
.------------.
| Hello Keep |
'------------'
Keep is a text game engine.
[ Room ]
There is a Magic Potion[1].
[ Inventory ]
Your inventory is empty.
[ Characters ]
Bob[2] is here.
[ Actions ]
[1] Talk to someone
[2] Use an item
John>
```

The player inputs an action number, and then a number for the target if necessary.

ie: the input `1 2` talks[1] to bob[2], and `2 1` uses[2] the potion[1].
1 change: 1 addition & 0 deletions src/main/kotlin/tech/alephia/keep/core/Game.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Game(

fun draw() {
scene.draw(this)
io.separator()
}

private fun createMap(scenes: List<Scene>) =
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/tech/alephia/keep/core/scenes/Scene.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class Scene(
}

private fun InOut.scene() {
separator()
title(name)
paragraph(narration)
}
Expand Down

0 comments on commit 4dc4bc5

Please sign in to comment.