{"id":15061037,"url":"https://github.com/phasereditor2d/phasereditor2d-scripts-arcade","last_synced_at":"2025-07-11T03:32:28.498Z","repository":{"id":210387601,"uuid":"726332216","full_name":"PhaserEditor2D/phasereditor2d-scripts-arcade","owner":"PhaserEditor2D","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-11T01:28:14.000Z","size":23202,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-20T03:35:18.535Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhaserEditor2D.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.MD","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-02T04:26:31.000Z","updated_at":"2023-12-08T11:05:12.000Z","dependencies_parsed_at":"2024-10-30T02:34:03.388Z","dependency_job_id":null,"html_url":"https://github.com/PhaserEditor2D/phasereditor2d-scripts-arcade","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"555f8de7eca2ca363c849e3bf072956f0b8d4939"},"previous_names":["phasereditor2d/phasereditor2d-scripts-arcade"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhaserEditor2D%2Fphasereditor2d-scripts-arcade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhaserEditor2D%2Fphasereditor2d-scripts-arcade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhaserEditor2D%2Fphasereditor2d-scripts-arcade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhaserEditor2D%2Fphasereditor2d-scripts-arcade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhaserEditor2D","download_url":"https://codeload.github.com/PhaserEditor2D/phasereditor2d-scripts-arcade/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225675083,"owners_count":17506272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T23:08:30.655Z","updated_at":"2024-11-21T04:37:20.414Z","avatar_url":"https://github.com/PhaserEditor2D.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phaser Editor 2D Arcade Physics Scripts (library)\n\nThis project contains a few Phaser Editor 2D scripts for setting Arcade physics to objects.\n\nThese script nodes are very basic and may fit on any Phaser Editor 2D project.\n\nThe scripts are coded in TypeScript with ES modules.\n\n## Installing (NPM)\n\nThis package depends on the following packages:\n\n- `@phasereditor2d/scripts-core`\n\nTo install this in your game you have to install dependencies too:\n\n```\nnpm install @phasereditor2d/scripts-core\nnpm install @phasereditor2d/scripts-arcade\n```\n\nAlso, you should add this package to the `phasereditor2d.config.json` file in your project, in the `scripts` section:\n\n```json\n{\n    \"scripts\": [\n        \"@phasereditor2d/scripts-core\",\n        \"@phasereditor2d/scripts-arcade\",\n    ]\n}\n```\n\n## Installing (vanilla JavaScript)\n\n* Get the files in the [browser](./browser/) folder and copy them into your JavaScript project. It includes Phaser Editor 2D files, JavaScript files, and TypeScript type definitions.\n* Add a `script` tag to the `index.html` file to load the `lib/phasereditor2d_scripts_arcade.js` file.\n\n## Summary\n\nThis library provides a couple of actions and events about the Arcade Physics system in Phaser. As a reminder, an action is executed by an event script or another action.\n\nThe events:\n\n* **On World Bounds Collide Event** - Is fired when an object collides with the world bounds.\n\nThe actions:\n\n* **Set Velocity Action** - Sets the velocity of the script's game object.\n* **Set X Velocity Action** - Sets the velocity's X value to the script's game object.\n* **Set Y Velocity Action** - Sets the velocity's Y value to the script's game object.\n* **Get GameObject From Body Action** - Gets the game object for the given physics body.\n* **Make Object Collider Action** - Creates a physics collider with the game object.\n* **Set Body Enable Action** - To enable/disable physics in the game object.\n* **Start Flip With Velocity Action** - Starts flipping the game object heading to the velocity vector.\n* **Start Follow Pointer Action** - Starts moving the game object toward the pointer position. \n* **If Body Touching** - A conditional action to test if the body touching state.\n\nThe base classes:\n\n* **Base Arcade Object Script** - A base class for Arcade-related scripts (prefab variants).\n\n## On World Collide Event\n\n*Class: `OnWorldBoundsCollideEventScript`*\n\nThis script listens to the [worldbounds](https://newdocs.phaser.io/docs/3.70.0/focus/Phaser.Physics.Arcade.Events.WORLD_BOUNDS) event. When the event is fired, it executes the children's scripts.\n\nThe event is fired only for objects with the body's [onWorldBounds](https://newdocs.phaser.io/docs/3.70.0/focus/Phaser.Physics.Arcade.Body-onWorldBounds) parameter set to `true`.\n\nYou can configure the sides of the world this event listens to, with the **UP**, **DOWN**, **LEFT**, **RIGHT** parameters.\n\n## Set Velocity Action\n\n*Class: `SetVelocityActionScript`*\n\nThis action sets the given **X** and **Y** velocity to the game object.\n\n## Set X Velocity Action\n\n*Class: `SetVelocityXActionScript`*\n\nThis action sets the given **X** velocity to the game object.\n\n## Set Y Velocity Action\n\n*Class: `SetVelocityXActionScript`*\n\nThis action sets the given **X** velocity to the game object.\n\n## Get Game Object From Body Action\n\nThis action gets the game object from the given body. The body is passed to this action in the first argument, and this action passes, in the first argument, the associated game object to the children. You can combine this action with the **On World Bounds Collide Event** event.\n\n## If Body Touching\n\nThis action tests the game object `body.touching` state. If it is touching, it executes the actions of the **Then actions** node, else, it executes the actions of the **Else actions** node.\n\nThis action provides the **Left**, **Right**, **Top**, and **Bottom** boolean parameters. If any of these parameters is `true` and the body touching state of the same side is `true`, then we say the object is touching and then execute the **Then actions**.\n\nThis action allows the **Action Target** component.\n\n## Make Object Collider Action\n\nThis action creates a collider with the game object and the given **Collide With** object. If you check the **Overlap Only** parameter, then it uses an overlap instead of a collide method.\n\nWhen there is a collision, this action executes the children nodes and passes as argument the collision event arguments.\n\nThis action allows the **Action Target** component.\n\n## Set Body Enable Action\n\nThis action updates the body's enable state with the **Enable** parameter's value.\n\nThis action allows the **Action Target** component.\n\n## Start Flip with Velocity Action\n\nThis action starts monitoring the game object velocity vector and change the flip state of the game object.\n\nIf the **Flip Horizontal** is on, then it changes the `flipX` property of the object. If the **Flip Vertical** is on, then it changes the `flipY` property of the object.\n\nBy default, it assumes the object is facing left and top in its initial position. You can change it with the **Facing Left** and **Facing Right** parameters.\n\nThis action allows the **Action Target** component.\n\n## Start Follow Pointer Action\n\nThis action starts monitoring the pointer and moves the game object towards the pointer's position.\n\nThis action allows the **Action Target** component.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphasereditor2d%2Fphasereditor2d-scripts-arcade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphasereditor2d%2Fphasereditor2d-scripts-arcade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphasereditor2d%2Fphasereditor2d-scripts-arcade/lists"}