JavaScript
Even though you can put more Javascript code in the main.js file and do a lot of things there, sometimes we want to do something in some part of our game. This is why you can also put some Javascript inside your game's script and you have a simple and pro way to do it.
The simple one, is using the $ command:
The syntax is pretty easy: "$ [Javascript Code]". Here are some examples:
The "pro" way is with functions. Yes, you can put a function inside and it will run it!
To control the flow of your game, you can make the function return either true (Will immediately execute the next statement.) or false (Will wait until the user clicks again.)
Example:
You can as well use variables in your script.
Last updated