{"id":16213951,"url":"https://github.com/nezvers/statemachine_system_for_godot","last_synced_at":"2025-03-19T09:31:09.418Z","repository":{"id":107586333,"uuid":"280511899","full_name":"nezvers/StateMachine_system_for_Godot","owner":"nezvers","description":"Flexible and lightweight StateMachine for Godot","archived":false,"fork":false,"pushed_at":"2020-08-27T18:49:12.000Z","size":28,"stargazers_count":21,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T17:46:57.418Z","etag":null,"topics":["gdscript","godot","machine","script","state","statemachine"],"latest_commit_sha":null,"homepage":"","language":"GDScript","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/nezvers.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-07-17T19:47:33.000Z","updated_at":"2023-08-27T18:42:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"c9103e8a-9dd4-4319-8110-74cd885d0667","html_url":"https://github.com/nezvers/StateMachine_system_for_Godot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nezvers%2FStateMachine_system_for_Godot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nezvers%2FStateMachine_system_for_Godot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nezvers%2FStateMachine_system_for_Godot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nezvers%2FStateMachine_system_for_Godot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nezvers","download_url":"https://codeload.github.com/nezvers/StateMachine_system_for_Godot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982141,"owners_count":20378605,"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":["gdscript","godot","machine","script","state","statemachine"],"created_at":"2024-10-10T11:09:11.785Z","updated_at":"2025-03-19T09:31:09.414Z","avatar_url":"https://github.com/nezvers.png","language":"GDScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# State Machine System for Godot\nFlexible and lightweight StateMachine for Godot and each system related code row is commented.\nStates are plain scripts without extending any class except default Reference what GDScript is. States are added to StateMachine through exported script Array. Decision on default State choice must be implemented per use case (Player, Camera, Pickup, Enemy).\n\nProject is also simple use case for platformer (Idle, Walk, Jump)\n\n## Usage\n* Create StateMachine inherited script for different types of use cases (example - PlayerStateMachine);\n* Create State inherited state scripts (example - PlayerState -\u003e PlayerIdle);\n* Use virtual functions inheritted from State (unhandled_input, physics_process, process, state_check);\n* Add State scripts into StateMachine exported script_array. PlayerStateMachine implements default state choice, you can change it to script_array[0] instead of String key.\n* For getting references to nodes or get_tree() use sm (state machine) - yield(sm.get_tree().create_timer(1.0), \"timeout\")\n\n## IMPORTANT\n* Each new state needs to implement:\n```\nfunc _init(_sm).(_sm)-\u003evoid:\n\tname = \"Idle\"\n```\n## Walkthrough\n\u003cdiv align=\"center\"\u003e\n      \u003ca href=\"https://www.youtube.com/watch?v=Dpf2f31zKic\"\u003e\n     \u003cimg \n      src=\"https://img.youtube.com/vi/Dpf2f31zKic/0.jpg\" \n      alt=\"State machine walkthrough\" \n      style=\"width:100%;\"\u003e\n      \u003c/a\u003e\n    \u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnezvers%2Fstatemachine_system_for_godot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnezvers%2Fstatemachine_system_for_godot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnezvers%2Fstatemachine_system_for_godot/lists"}