Navigation

Custom Code

Coding in Quest just requires you to know JavaScript and have an understanding of how Phaser 3 works.

Each Scene from the project becomes a class in its own js file. These Classes are listed on top of the code editor and you can write code for any scene as appropriate.

The basic structure for the scene code is also setup in each file, making it easy to insert any code logic that you want. Since Quest creates the groups and elements for you, we have a couple of APIs that allow you to access any element or group in your project (See APIs in help docs).

Once you have the element or the group, you can use any Phaser APIs to write code and it will work seamlessly with Quest.

Quest Code Editor

As an example, to change the alpha of the element colorBar to 0.5, you would do:

let colorBar = this.getElement("colorBar");

colorBar.setAlpha(0.5);

OR to change the text of scoreText to 100, you would do:

let scoreText = this.getElement("scoreText");

scoreText.setText("100");

By using the provided APIs and the whole of the Phaser 3 API you have access to a massive range of features, right at your fingertips.