Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Here's the example: https://gitlab.com/lunafromthemoon/renjs-minigame-example

Your minigame is in a folder called minigame, it's the breakout example from Phaser (https://phaser.io/examples/v2/games/breakout). The only change is that the creation of the game is inside a function called createMinigame(callback), the callback is a function that the minigame has to call when it's over. In this case, the minigame is over when you lose three lives. By calling the callback function, the control returns to RenJS. Also, the  score of the minigame is sent as a parameter to the callback function, so that I can have this information in the story.

To start the minigame, I use an action "call", to the CustomContent function minigame. This function hides the RenJS canvas, calls the createMinigame() function and creates the callback, that will store the score from the minigame into RenJS.logicManager.vars, show again the RenJS canvas, and then continue with the story. 

The file for the minigame has to be called from the index too.

The example is very simple and the transition between the story and the minigame is very rough, you should code a nicer one.

Thank you ! This is exactly what i need :)

Deleted 6 years ago