Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Construct 3 Manual
https://github.com/xhxiaiein/construct3-manual
Admin
Construct 3 documentation in Markdown — Manual, Addon SDK, Game Services
Tokens:
976,599
Snippets:
9,401
Trust Score:
8.1
Update:
2 weeks ago
Context
Chat
Benchmark
63.47
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Start fade and handle fadeoutend event Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/scripting/scripting-reference/behavior-interfaces/fade.md Example showing how to start a fade on an instance with the Fade behavior and log to the console when the fade finishes. The event listener is added before starting the fade to ensure the event is caught. ```javascript // Handle "fadeoutend" event which logs to console when // the fade has finished inst.behaviors.Fade.addEventListener("fadeoutend", e => { console.log("Fade finished!"); }); // Start the Fade effect running inst.behaviors.Fade.startFade(); ``` -------------------------------- ### More startTween examples for different properties and options Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/scripting/scripting-reference/behavior-interfaces/tween.md Shows valid calls to `startTween` for various properties: X position, position, size with looping ping-pong, color, and a value tween with a custom start value. The final example stores the returned tween to read its `value` over time. ```javascript // Tween X position to 300 over 2 seconds linearly Tween.startTween("x", 300, 2, "linear"); // Tween position to (300, 300) over 2 seconds with ease "in-out-sine" Tween.startTween("position", [300, 300], 2, "in-out-sine"); // Looping ping-pong tween to size 200x200 every 0.5 seconds Tween.startTween("size", [200, 200], 0.5, "out-sine", { loop: true, pingPong: true }); // Tween color to blue over 1.5 seconds linearly Tween.startTween("color", [0, 0, 1], 1.5, "linear"); // Value tween from 100 to 200 linearly over 3 seconds const t = Tween.startTween("value", 200, 3, "linear", { startValue: 100 }); // (then read t.value over time) ``` -------------------------------- ### Example addon.json metadata for a Construct 3 plugin Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Addon-SDK/guide/addon-metadata.md Example addon.json for a Construct 3 plugin. The editor reads this file before loading other files to determine if the addon can be installed, so fields like the ID and version must exactly match values used elsewhere in the addon's files. ```json { "is-c3-addon": true, "sdk-version": 2, "type": "plugin", "name": "My custom plugin", "id": "MyCompany_MyAddon", "version": "1.0.0.0", "author": "Scirra", "website": "https://www.construct.net", "documentation": "https://www.construct.net", "description": "Example custom Construct 3 plugin.", "editor-scripts": [ "plugin.js", "type.js", "instance.js" ], "file-list": [ "c3runtime/plugin.js", "c3runtime/type.js", "c3runtime/instance.js", "c3runtime/conditions.js", "c3runtime/actions.js", "c3runtime/expressions.js", "lang/en-US.json", "aces.json", "addon.json", "icon.svg", "instance.js", "plugin.js", "type.js" ] } ``` -------------------------------- ### Start flowchart (by name) Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/plugin-reference/flowchart-controller.md Starts a new flowchart instance, similar to the Start flowchart action. It uses the Start node tag parameter to specify the starting node, and the Flowchart tag to identify the instance. Set as current optionally makes it the current flowchart. ```APIDOC ## Start flowchart (by name) ### Description Starts a new flowchart instance. Use the **Start node tag** parameter so the flowchart starts in that node, if left empty the flowchart's starting node set in the editor is used. The **Flowchart tag** parameter assigns the flowchart instance a tag to later identify it elsewhere in the event sheet. The **Set as current** parameter is a shortcut to immediately set the new flowchart as the current one. ### Parameters - **Start node tag** (string) - Optional - The tag of the node to start at. If empty, the editor's starting node is used. - **Flowchart tag** (string) - Required - A tag to identify the flowchart instance. - **Set as current** (boolean) - Optional - If true, the new flowchart is set as the current one. ### Notes Starting a flowchart with a previously used tag will reset the existing flowchart. ``` -------------------------------- ### Combo property creation example Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Addon-SDK/guide/language-file.md Example of creating a combo property with items 'off', 'sounds-only', and 'sounds-and-music'. ```javascript new SDK.PluginProperty("combo", "timescale-audio", { initialValue: "off", items: ["off", "sounds-only", "sounds-and-music"] }) ``` -------------------------------- ### Play Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/plugin-reference/3d-model.md Start playing the specified animation, with optional looping and starting progress. ```APIDOC ## Play ### Description Start playing the specified animation, use the **"Loop"** parameter to choose if the animation should loop and use the **"Progress"** parameter to choose where the animation should start from, using a value in the range **[0 - 1]**. ### Parameters - **Animation** (string) - Required - The name of the animation to play. - **Loop** (boolean) - Required - Whether the animation should loop. - **Progress** (number) - Required - The starting progress of the animation, in the range [0 - 1]. ``` -------------------------------- ### Start flowchart Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/plugin-reference/flowchart-controller.md Starts a new flowchart instance. Use the Start node tag parameter to specify the starting node, or leave it empty to use the editor's starting node. The Flowchart tag assigns an identifier to the instance, and Set as current optionally makes it the current flowchart. ```APIDOC ## Start flowchart ### Description Starts a new flowchart instance. Use the **Start node tag** parameter so the flowchart starts in that node, if left empty the flowchart's starting node set in the editor is used. The **Flowchart tag** parameter assigns the flowchart instance a tag to later identify it elsewhere in the event sheet. The **Set as current** parameter is a shortcut to immediately set the new flowchart as the current one. ### Parameters - **Start node tag** (string) - Optional - The tag of the node to start at. If empty, the editor's starting node is used. - **Flowchart tag** (string) - Required - A tag to identify the flowchart instance. - **Set as current** (boolean) - Optional - If true, the new flowchart is set as the current one. ### Notes Starting a flowchart with a previously used tag will reset the existing flowchart. ``` -------------------------------- ### Start recording Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/plugin-reference/video-recorder.md Starts recording a video of the main display canvas. Excludes form controls and other HTML elements. Allows specifying video/audio formats, framerate, and quality. ```APIDOC ## Start recording ### Description Starts recording a video of the main display canvas. This excludes form controls like buttons and text inputs because they are HTML elements that float above the canvas. Specific video and audio formats can be chosen, but it is recommended to leave them at *Auto* to ensure a supported format is used, or set to *None* to omit either the video or audio from the recording. A custom framerate can be set but the default 0 indicates the display rate. The quality in kilobits per second (kbps) can also be set, determining the video quality vs. size tradeoff. Use *Stop recording* to end the recording, after which *On recording ready* will trigger so the video can be downloaded. ### Parameters - **Video format** (string) - Optional - The video format to use. Recommended to leave at *Auto* or set to *None* to omit video. - **Audio format** (string) - Optional - The audio format to use. Recommended to leave at *Auto* or set to *None* to omit audio. - **Framerate** (number) - Optional - The custom framerate. Default 0 indicates the display rate. - **Quality** (number) - Optional - The quality in kilobits per second (kbps), determining video quality vs. size tradeoff. ### Notes - Excludes form controls and other HTML elements. - Use *Stop recording* to end the recording. - After stopping, *On recording ready* will trigger. ``` -------------------------------- ### PluginProperty integer example Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Addon-SDK/guide/language-file.md Example of creating an integer plugin property with ID 'test-property' and initial value 0. ```javascript new SDK.PluginProperty("integer", "test-property", 0) ``` -------------------------------- ### Start User Media recording Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/plugin-reference/video-recorder.md Starts recording video and/or audio from a User Media object's input. Requires the *On media request approved* trigger to have fired before this can be used. ```APIDOC ## Start User Media recording ### Description Starts recording video and/or audio from a [User Media](../plugin-reference/user-media.md) object's input. *On media request approved* must trigger before this can be used. ### Prerequisites - The *On media request approved* trigger must have fired. ### Notes - Records from a User Media object's input. ``` -------------------------------- ### Example XP Bonus JSON Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Game-Services/achievements/api-objects/xp-bonus.md Example JSON object for an XP bonus with 'from' set to 5 and 'bonus' set to 100. ```json { "from": 5, "bonus": 100 } ``` -------------------------------- ### Start group Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/plugin-reference/browser.md Starts a group in the browser console. Groups appear indented and can be optionally named. Use this action followed by Log actions and then End group. ```APIDOC ## Start group ### Description Start a group in the browser console. Groups appear indented, and the browser may give the option to expand/collapse the group easily. Groups can optionally be named. To create a group, use *Start group*, then a series of *Log* actions, then the *End group* action. ### Parameters - **Name** (string) - Optional - The name of the group. ``` -------------------------------- ### Example Meta Data JSON Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Game-Services/authentication/api-objects/patreon/patreon-meta-data.md Example of the Meta Data object returned with a player's Patreon login provider. Contains a memberships array with PatreonMembership objects. ```json { "memberships": [ { ... }, { ... } ] } ``` -------------------------------- ### runOnStartup basic usage Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/scripting/using-scripting/script-files.md Use this in the main script to run code once the runtime is ready. The callback can be async, so you can use await for asynchronous initialization. Note that the callback runs when the loading screen appears, before objects exist. ```javascript runOnStartup(async runtime => { // This code runs on startup with // the 'runtime' variable available }); ``` -------------------------------- ### Example Team JSON Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Game-Services/leaderboards/api-objects/team.md Example JSON object representing a team with a teamID and name. The teamID is a unique identifier (GUID) and the name is a string that cannot exceed 64 characters. ```json { "teamID": "58094144-d35d-4499-aeb9-71017fb37748", "name": "Red Team" } ``` -------------------------------- ### _getInitProperties() Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/scripting/scripting-reference/addon-sdk-interfaces/isdkinstancebase.md Call this in the constructor to get an array of the instance's properties to create the instance with. ```APIDOC ## _getInitProperties() ### Description Call this in the constructor to get an array of the instance's properties to create the instance with. ### Method _getInitProperties() ### Parameters None ### Returns Array of instance properties. ``` -------------------------------- ### PushContext(prefix) Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Addon-SDK/reference/misc-interfaces/ilang.md Pushes a prefix onto the context stack, affecting subsequent Get() calls. For example, PushContext("foo") followed by Get(".bar") returns the same string as Get("foo.bar"). Must be paired with PopContext(). ```APIDOC ## PushContext(prefix) ### Description Pushes a prefix to the context stack. For example `PushContext("foo")` followed by `Get(".bar")` will return the same string as if `Get("foo.bar")` were used. Pushing a context beginning with a dot will append to the current prefix, but pushing an entry not beginning with a dot will reset the current prefix. **Note:** be sure to always call `PopContext()` afterwards. ### Method PushContext ### Parameters - **prefix** (string) - Required - The prefix to push onto the context stack. ### Remarks - Always call `PopContext()` after pushing a context to avoid stack imbalance. ``` -------------------------------- ### animationName Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/scripting/scripting-reference/plugin-interfaces/3d-model.md Gets or sets the current animation. When set, the animation changes to the start of the new animation and doesn't play. ```APIDOC ## animationName ### Description Returns the current animation. When set, the animation changes to the start of the new animation and doesn't play. ### Returns - **string** - The name of the current animation. ### Parameters (when set) - **value** (string) - The name of the animation to set. ``` -------------------------------- ### Log detected operating system to console on startup Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/scripting/scripting-reference/interfaces/iplatforminfo.md Use this snippet to log the detected operating system to the console when the game starts. It accesses the platformInfo.os property via the runtime object passed to runOnStartup. ```javascript // Example: log detected operating system to console on startup runOnStartup(async runtime => { console.log("The detected OS is: " + runtime.platformInfo.os); }); ``` -------------------------------- ### Flash behavior example Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/scripting/scripting-reference/behavior-interfaces/flash.md Demonstrates how to listen for the 'flashend' event and trigger a flash effect on an instance using the Flash behavior. ```javascript // Handle "flashend" event which logs to console when // the flash has finished inst.behaviors.Flash.addEventListener("flashend", e => { console.log("Flash finished!"); }); // Start flashing with the Flash behavior for 2 seconds inst.behaviors.Flash.flash(0.1, 0.1, 2); ``` -------------------------------- ### Get an IBehaviorInstance via IInstance.behaviors Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/scripting/scripting-reference/object-interfaces/ibehaviorinstance.md Access a behavior instance via the behaviors property of an IInstance, using the behavior's name. This example retrieves the first Sprite instance and then its Platform behavior instance. ```javascript const mySpriteInst = runtime.objects.Sprite.getFirstInstance(); const myBehaviorInst = mySpriteInst.behaviors.Platform; // ... do something with myBehaviorInst ... ``` -------------------------------- ### startFollowing(inst, fromCurrentPosition = false) Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/scripting/scripting-reference/behavior-interfaces/follow.md Begins following the specified IInstance, recording its changes over time and updating the object after the delay period. Optionally, set fromCurrentPosition to true to start following immediately. ```APIDOC ## startFollowing(inst, fromCurrentPosition = false) ### Description Begins following the specified IInstance. This starts recording the changes over time of the specified object, and after the delay period has passed, it will then start following the changes for the enabled properties. Until the delay has passed, `hasFollowData` will be false as there is not yet any data to follow. Alternatively the `fromCurrentPosition` parameter can be set to `true`, which allows immediate following. When enabled this creates an initial history entry based on the following object's current state in the past at the delay time. Therefore `hasFollowData` is immediately true and the object is able to immediately start updating. This has the effect of interpolating from the following object's starting position to the followed object's starting position over the delay time. ### Parameters - **inst** (IInstance) - Required - The instance to follow. - **fromCurrentPosition** (boolean) - Optional - If true, starts following immediately by creating an initial history entry based on the following object's current state in the past at the delay time. Defaults to false. ``` -------------------------------- ### Start screen recording Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/plugin-reference/video-recorder.md Starts recording a video of the user's entire screen. Requires the *Is screen recording supported* condition to be true. Browsers prompt the user for permission, and this action may only be allowed in a user input trigger. ```APIDOC ## Start screen recording ### Description Starts recording a video of the user's entire screen. This only works when the *Is screen recording supported* condition is true. For security reasons, browsers will prompt the user before the recording starts. To avoid the prompt annoying users, this action may only be allowed in a user input trigger, e.g. *On button clicked*, *On touch start* etc. Some browsers also provide options in the prompt to record either the browser tab (which will include non-canvas elements like form controls), a different app, or the screen. Specific video and audio formats can be chosen, but it is recommended to leave them at *Auto* to ensure a supported format is used, or set to *None* to omit either the video or audio from the recording. Note that if audio is included, the video can only include audio played by the project itself, unless *System audio* is checked, which allows for recording all audio output from the system including other apps; note however the user may still need to opt-in to including system audio in the permission prompt. The quality in kilobits per second (kbps) can also be set, determining the video quality vs. size tradeoff. Use *Stop recording* to end the recording, after which *On recording ready* will trigger so the video can be downloaded. ### Parameters - **Video format** (string) - Optional - The video format to use. Recommended to leave at *Auto* or set to *None* to omit video. - **Audio format** (string) - Optional - The audio format to use. Recommended to leave at *Auto* or set to *None* to omit audio. - **Quality** (number) - Optional - The quality in kilobits per second (kbps), determining video quality vs. size tradeoff. - **System audio** (boolean) - Optional - If checked, allows recording all audio output from the system including other apps. User may need to opt-in in the permission prompt. ### Prerequisites - The *Is screen recording supported* condition must be true. - Must be triggered by a user input event (e.g., *On button clicked*, *On touch start*). ### Notes - Browsers will prompt the user for permission before recording starts. - Use *Stop recording* to end the recording. - After stopping, *On recording ready* will trigger. ``` -------------------------------- ### Install ConstructServices package Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Game-Services/index.md Install the Construct Services class library using the .NET Core CLI, NuGet CLI, or Package Manager Console. Each command installs the ConstructServices package. ```none dotnet add package ConstructServices ``` ```none nuget install ConstructServices ``` ```none Install-Package ConstructServices ``` -------------------------------- ### _getInitProperties() Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/scripting/scripting-reference/addon-sdk-interfaces/isdkbehaviorinstancebase.md Call this in the constructor to get an array of the behavior instance's properties. ```APIDOC ## _getInitProperties() ### Description Call this in the constructor to get an array of the behavior instance's properties. ### Method _getInitProperties() ### Parameters None. ### Returns Array of the behavior instance's properties. ``` -------------------------------- ### Request install Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/plugin-reference/browser.md Prompts the user to install the page as a web app (PWA). ```APIDOC ## Request install ### Description Prompts the user to install the current page as a web app, where available (e.g., PWA installs). Only allowed when installation is available and typically within a user input trigger. ### Notes - Only available in browsers supporting PWA installs. - Must be used in a user input trigger (e.g., button click). - If successful, the *On app installed* trigger fires. ``` -------------------------------- ### Example Rating Object Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Game-Services/ratings/api-objects/rating-object.md Example of a Rating object showing its properties: value, maxRating, date, and formattedDate. ```json { "value": 4, "maxRating": 5, "date": "2025-09-22T15:07:16.833", "formattedDate": "9/22/2025 3:07:16 PM" } ``` -------------------------------- ### SDK.Quad Interface Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Addon-SDK/reference/geometry-interfaces/quad.md Documentation for the SDK.Quad interface, including its constructor and all methods. ```APIDOC ## Constructor ```javascript new SDK.Quad(); new SDK.Quad(tlx, tly, trx, try_, brx, bry, blx, bly); ``` ### Description Creates a new `SDK.Quad` instance. With no parameters, all coordinates default to zero. With parameters, sets the four points of the quad. ### Parameters - `tlx` (number) - Optional - X coordinate of the top-left point. - `tly` (number) - Optional - Y coordinate of the top-left point. - `trx` (number) - Optional - X coordinate of the top-right point. - `try_` (number) - Optional - Y coordinate of the top-right point (named with underscore to avoid the `try` keyword). - `brx` (number) - Optional - X coordinate of the bottom-right point. - `bry` (number) - Optional - Y coordinate of the bottom-right point. - `blx` (number) - Optional - X coordinate of the bottom-left point. - `bly` (number) - Optional - Y coordinate of the bottom-left point. ### Returns A new `SDK.Quad` instance. ## Methods ### set(tlx, tly, trx, try_, brx, bry, blx, bly) #### Description Sets all four points of the quad in a single call. #### Parameters - `tlx` (number) - Required - X coordinate of the top-left point. - `tly` (number) - Required - Y coordinate of the top-left point. - `trx` (number) - Required - X coordinate of the top-right point. - `try_` (number) - Required - Y coordinate of the top-right point. - `brx` (number) - Required - X coordinate of the bottom-right point. - `bry` (number) - Required - Y coordinate of the bottom-right point. - `blx` (number) - Required - X coordinate of the bottom-left point. - `bly` (number) - Required - Y coordinate of the bottom-left point. ### setRect(left, top, right, bottom) #### Description Sets the quad's points to represent an axis-aligned rectangle using the given positions. #### Parameters - `left` (number) - Required - Left edge of the rectangle. - `top` (number) - Required - Top edge of the rectangle. - `right` (number) - Required - Right edge of the rectangle. - `bottom` (number) - Required - Bottom edge of the rectangle. ### copy(quad) #### Description Sets all points of the quad by copying another `SDK.Quad`. #### Parameters - `quad` (SDK.Quad) - Required - The quad to copy from. ### setTlx(n) #### Description Sets the X coordinate of the top-left point. #### Parameters - `n` (number) - Required - The new X coordinate. ### setTly(n) #### Description Sets the Y coordinate of the top-left point. #### Parameters - `n` (number) - Required - The new Y coordinate. ### setTrx(n) #### Description Sets the X coordinate of the top-right point. #### Parameters - `n` (number) - Required - The new X coordinate. ### setTry(n) #### Description Sets the Y coordinate of the top-right point. #### Parameters - `n` (number) - Required - The new Y coordinate. ### setBrx(n) #### Description Sets the X coordinate of the bottom-right point. #### Parameters - `n` (number) - Required - The new X coordinate. ### setBry(n) #### Description Sets the Y coordinate of the bottom-right point. #### Parameters - `n` (number) - Required - The new Y coordinate. ### setBlx(n) #### Description Sets the X coordinate of the bottom-left point. #### Parameters - `n` (number) - Required - The new X coordinate. ### setBly(n) #### Description Sets the Y coordinate of the bottom-left point. #### Parameters - `n` (number) - Required - The new Y coordinate. ### getTlx() #### Description Gets the X coordinate of the top-left point. #### Returns (number) - The X coordinate. ### getTly() #### Description Gets the Y coordinate of the top-left point. #### Returns (number) - The Y coordinate. ### getTrx() #### Description Gets the X coordinate of the top-right point. #### Returns (number) - The X coordinate. ### getTry() #### Description Gets the Y coordinate of the top-right point. #### Returns (number) - The Y coordinate. ### getBrx() #### Description Gets the X coordinate of the bottom-right point. #### Returns (number) - The X coordinate. ### getBry() #### Description Gets the Y coordinate of the bottom-right point. #### Returns (number) - The Y coordinate. ### getBlx() #### Description Gets the X coordinate of the bottom-left point. #### Returns (number) - The X coordinate. ### getBly() #### Description Gets the Y coordinate of the bottom-left point. #### Returns (number) - The Y coordinate. ### setFromRect(rect) #### Description Sets the points of the quad to an axis-aligned rectangle given by an `SDK.Rect`. #### Parameters - `rect` (SDK.Rect) - Required - The rectangle to set from. ### setFromRotatedRect(rect, angle) #### Description Sets the points of the quad to a rotated rectangle given by an `SDK.Rect`, rotated about the origin by `angle` in radians. #### Parameters - `rect` (SDK.Rect) - Required - The rectangle to set from. - `angle` (number) - Required - The rotation angle in radians. ### getBoundingBox(rect) #### Description Calculates the bounding box of the quad and stores the result by writing to a given `SDK.Rect`. #### Parameters - `rect` (SDK.Rect) - Required - The rectangle to store the bounding box. ### midX() #### Description Returns the average of the four points in the quad on the X axis. #### Returns (number) - The average X coordinate. ### midY() #### Description Returns the average of the four points in the quad on the Y axis. #### Returns (number) - The average Y coordinate. ### intersectsSegment(x1, y1, x2, y2) #### Description Tests if a segment, given as the line between points (x1, y1) and (x2, y2), intersects this quad. #### Parameters - `x1` (number) - Required - X coordinate of the first point. - `y1` (number) - Required - Y coordinate of the first point. - `x2` (number) - Required - X coordinate of the second point. - `y2` (number) - Required - Y coordinate of the second point. #### Returns (boolean) - True if the segment intersects the quad, false otherwise. ### intersectsQuad(quad) #### Description Tests if another `SDK.Quad` intersects this quad. #### Parameters - `quad` (SDK.Quad) - Required - The other quad to test against. #### Returns (boolean) - True if the quads intersect, false otherwise. ### containsPoint(x, y) #### Description Tests if the given point is inside the bounds of this quad. #### Parameters - `x` (number) - Required - X coordinate of the point. - `y` (number) - Required - Y coordinate of the point. #### Returns (boolean) - True if the point is inside the quad, false otherwise. ``` -------------------------------- ### Move To behavior: move to position and log arrival Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/scripting/scripting-reference/behavior-interfaces/move.md Demonstrates using the Move To behavior on an instance: subscribing to the "arrived" event and starting movement to (100,100). Note that the instance variable `inst` is assumed to have the Move To behavior. ```javascript // Handle "arrived" event which logs to console when // movement has finished inst.behaviors.MoveTo.addEventListener("arrived", e => { console.log("Arrived!"); }); // Start the Move To behavior moving to (100, 100) inst.behaviors.MoveTo.moveToPosition(100, 100); ``` -------------------------------- ### testOverlap usage example Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/scripting/scripting-reference/interfaces/icollisionengine.md Example showing how to use runtime.collisions.testOverlap to check if two instances overlap and log a message when a collision is found. ```javascript // Example code if (runtime.collisions.testOverlap(instA, instB)) { console.log("Collision found!"); } ``` -------------------------------- ### startMoving() Source: https://github.com/xhxiaiein/construct3-manual/blob/main/Construct3-Manual/scripting/scripting-reference/behavior-interfaces/pathfinding.md Automatically starts moving the object along the found path. Can only be used after a path has been successfully found. ```APIDOC ## startMoving() ### Description Automatically starts moving the object along the found path. This can only be used after a path has been successfully found. ### Parameters None. ### Returns None. ```