Monogatari v2.0.0.beta.7
Download Link: Monogatari-v2.0.0.beta.7.zip
Remember this is a Beta release meant for testing and bugs are expected, everything is also prone to change a lot. If you're using it to release a game, you should warn your players as chances are it will eventually break.
📰 Release Change Log
🌟 New Features
- Actions have four new hooks
beforeRun
,afterRun
,beforeRevert
andafterRevert
, however this are mostly for internal use and users should use thewillProceed
,didProceed
andwillRollback
,didRollback
ones - Monogatari now exports the
random-js
library to perform random numbers related functionalities - New
monogatari.random (min, max)
function was added that returns a cryptographyc random number - Added files required for Apple's app notarization process so the electron version of a game gets notarized automatically
- New
timer-display
component was added to enable timed actions - Choices now allow a
Timer
property, the following example will randomly pick a choice if none was picked in 5 seconds:
{
'Choice': {
'Dialog': 'y Have you already read some documentation?',
'Timer': {
// Time in milliseconds
time: 5000,
// The function to run when the time is over
callback: () => {
// Get all choices being shown and that are not disabled
const choices = monogatari.element ().find ('[data-choice]:not([disabled])');
// Pick one of those options randomly
const random = choices.get (monogatari.random (0, choices.length - 1));
// Fake a click on it
random.click ();
// Promise friendly!
return Promise.resolve ();
}
},
'Yes': {
'Text': 'Yes',
'Do': 'jump Yes'
},
'No': {
'Text': 'No',
'Do': 'jump No'
}
}
}
Want to change the color of the timer-display
? That's simple!
timer-display > div {
background: '<some CSS Color>';
}
🐛 Bug Fixes
- Main menu music would stop playing if entering any other menu
- Position classes (left, right, center) where being overridden and the images would always be shown centered
- In some cases the wrong character would be shown when rolling back a
show character
statement - Under some conditions (mainly on node), electron-only functions could be triggered and cause an error
- When rolling back to the beginning of a label, the game could enter an invalid state where the current
step
was a negative number - Using
url()
or anygradient()
CSS properties in theshow background
orshow scene
statements would not work - Reversible functions would still require the user to click to advance even if the function returned
true
📦 Misc
- The npm package has been updated to this latest version
- Cypress is now being used to perform e2e testing
- Conditionals implementation has been changed and should be more reliable when rolling back
- Choices implementation was simplified
How To Upgrade
If you were already using a previous release from v2.x.x
, then upgrading is as simple as replacing the files in your engine directory with the new ones.
If you are planning to upgrade from a game made with the v1.4.1
release, we recommend you reading the Upgrade Guide