-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Byson94 edited this page Aug 25, 2024
·
1 revision
LiteForge GD engine is a 'small' game engine made with GDevelop.
This engine uses JavaScript as its scripting language, but it also requires some extra codes to run. Keep scrolling, we have a tutorial for you.
For running JS you would have to use 'runtimescene' of GDevelop to run the JS.
Example:
// Use the runtimeScene variable available in the code context
let scene = runtimeScene;
// Get all instances of the object named "object"
let objects = scene.getObjects("Your object name");
// Check if the object exists
if (objects.length > 0) {
// the code you are trying to do
}
next off this engine would run your code infinitely so you would have to use a code to just run it once. You can use the pre-made variable "hasMoved" to just run once.
Example on how to access the "hasMoved" variable:
const sceneVariable = runtimeScene.getVariables().get(hasMoved);