- 1. Getting Started with OdyC
- 2. Naming Your Game
- 3. The Hero
- 4. How to Draw?
- 5. The Map
- 6. Dialogues
- 7. Sound in the Game
- 8. Advanced Template Parameters
- 9. Camera Control
- 10. Integrating Events
- 11. Event Target Manipulation
- 12. Dynamic Hero Modification
- 13. Modifying a Cell
- 14. Global Model Modification
- 15. Orchestration of Dialogues, Sounds, and Endings
- 16. Dynamically Loading Maps
Creating a map is essential for bringing your game to life. It consists of two main elements: templates
and the map
parameter.
Templates
Templates are models that define reusable elements in your game, such as walls, enemies, or treasures. You can think of them as building blocks.
For example, to define a template for a wall:
Here, the character X
represents a wall and is associated with a specific sprite. You can use any character to represent different elements in your templates.
Drawing the Map
The map
uses the previously defined templates to create the game environment. Each character in the map
corresponds to a template and allows you to draw the map.
Here’s how to use the wall template to draw an enclosure:
- Each character present in
templates
will be transformed into the corresponding object in the game. - New lines indicate the start of a new row.
- Spaces, tabs, and empty lines are ignored.
- Any other character is interpreted as an empty space.
Now it’s your turn! Add objects, expand the map, experiment to create a rich and interesting world for your game.
Loading editor...
createGame({ player: { sprite: ` ...99... ...88... .000000. 0.0000.0 8.0000.8 ..3333.. ..3..3.. ..0..0.. `, position: [4, 4], }, })