You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Leo Yulin Li edited this page Mar 19, 2016
·
1 revision
EVENTS{}
What is an event?
Event in WHAS has nothing to do with JavaScript Event... Instead, it refers to the event of the game. To avoid the confusion, now we would just call it Event Object. Currently, Event Object are objects that contain a function run() for execution and store in const EVENTS{} as values. Events will run line by line in EVENTS{} and stop when save.eventBreak is true. Below is a basic structure of const EVENTS{}.
We are not sure if we still want to use the key value pair since there is not really a point for using it.
List of useable Event Object
RefreshDisplay(String) Update element with id="display" to String.
Choice([arrayOfOptions]) Clear element with id="options", and loop arrayOfOptions.
Option([]) Intake an array, and print the first element of the array to HTML element with id="options" as a button. When user click on the button, the rest of the array will run as Event Object.
gotoLine(lineNumber) jump to event object on that lineNumber.
weaponEquip(weaponID) update inventory with weapon with weaponID