{"id":15061039,"url":"https://github.com/phasereditor2d/phasereditor2d-scripts-random","last_synced_at":"2026-01-03T01:04:53.894Z","repository":{"id":216581584,"uuid":"737260471","full_name":"PhaserEditor2D/phasereditor2d-scripts-random","owner":"PhaserEditor2D","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-11T01:13:52.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-09T12:07:11.508Z","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}},"created_at":"2023-12-30T11:37:37.000Z","updated_at":"2024-01-11T01:02:31.000Z","dependencies_parsed_at":"2024-01-11T01:23:25.802Z","dependency_job_id":"a7a9a78d-1465-4f89-84ba-e125927aa566","html_url":"https://github.com/PhaserEditor2D/phasereditor2d-scripts-random","commit_stats":null,"previous_names":["phasereditor2d/phasereditor2d-scripts-random"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhaserEditor2D%2Fphasereditor2d-scripts-random","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhaserEditor2D%2Fphasereditor2d-scripts-random/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhaserEditor2D%2Fphasereditor2d-scripts-random/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhaserEditor2D%2Fphasereditor2d-scripts-random/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhaserEditor2D","download_url":"https://codeload.github.com/PhaserEditor2D/phasereditor2d-scripts-random/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243701311,"owners_count":20333616,"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.780Z","updated_at":"2026-01-03T01:04:53.853Z","avatar_url":"https://github.com/PhaserEditor2D.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phaser Editor 2D Random Scripts (library)\n\nThis project contains Phaser Editor 2D scripts for configuring random actions.\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-random\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-random\"\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_random.js` file.\n\n## Summary\n\nThis library provides a few actions for using random values in your game. You can configure the domain of the random values by using the configuration components.\n\nAs a reminder, an action is executed by an event script or another action.\n\nThe actions:\n\n* **Set Random X Action** - Set a random value to the object's X.\n* **Set Random Y Action** - Set a random value to the object's X.\n\nThe configuration components:\n\n* **Random Between Config** - To select an integer random value between two numbers.\n* **Random Multiple Config** - To select an integer random multiple between two numbers.\n* **Random In Array Config** - To pick a random value in an array of options.\n\n## Set Random X Action\n\n*Class: SetRandomXActionScript*\n\nThis action sets a random X value to the game object. It requires that you add to this node one of the random configuration components.\n\nIt allows \n\n## Set Random Y Action\n\n*Class: SetRandomYActionScript*\n\nThis action sets a random Y value to the game object. It requires that you add to this node one of the random configuration components.\n\n## Random Between Config\n\nThis user component contains the configuration for generating a random integer values between the given parameters **Min** and **Max**.\n\n## Random Multiple Config\n\nThis user component contains the configuration for generating random integer values between the given parameters **Min** and **Max**, but it is also a multiple of the **Multiple** parameter.\n\nEg., with a multiple of 10, the possible values between 10 and 30 are 10, 20, and 30.\n\n## Random In Array Config\n\nThis user component contains the parameters for picking a random number from an array of options. You can write the array in the **Options** parameters, following a JSON array format. Like this: `[10, 34, 2, 89, 20]`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphasereditor2d%2Fphasereditor2d-scripts-random","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphasereditor2d%2Fphasereditor2d-scripts-random","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphasereditor2d%2Fphasereditor2d-scripts-random/lists"}