- 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
Using the setAll
function provided by the game
object allows for the simultaneous modification of all objects sharing the same symbol. This function requires two parameters: the symbol of the elements to be modified and an object representing the new parameters to be applied.
Tip
You can also remove all elements with the same symbol and then create a new object at a specific position:
This feature enables the creation of game mechanics where the player’s interaction with an element can influence the entire level, such as changing the appearance of all similar obstacles upon a collision. Experiment with this capability to energize your levels and offer interactive and evolving puzzles that enrich the gaming experience.
Loading editor...
const game = createGame({ player: { sprite: ` ...99... ...88... .000000. 0.0000.0 8.0000.8 ..3333.. ..3..3.. ..0..0.. `, position: [4, 4], }, templates: { X: { sprite: 9 }, }, map: ` XXXXXXXX X.X....X X.X.XX.X X.X..X.X X.X..X.X X.XXXX.X X......X XXXXXXXX ` })