{"id":21299712,"url":"https://github.com/ericoporto/controlz","last_synced_at":"2026-03-19T19:46:02.921Z","repository":{"id":65116102,"uuid":"204580632","full_name":"ericoporto/controlz","owner":"ericoporto","description":"Move your character with keyboard or joystick controlz for Adventure Game Studio.","archived":false,"fork":false,"pushed_at":"2024-06-23T23:52:20.000Z","size":1590,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-22T07:44:11.082Z","etag":null,"topics":["adventure-game-studio","adventuregamestudio","ags","ags-script","gamepad","keyboard"],"latest_commit_sha":null,"homepage":"https://www.adventuregamestudio.co.uk/forums/index.php?topic=57427.0","language":"AGS Script","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/ericoporto.png","metadata":{"files":{"readme":"README.bbcode","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"ericoporto"}},"created_at":"2019-08-26T23:43:42.000Z","updated_at":"2024-06-23T23:52:23.000Z","dependencies_parsed_at":"2024-06-24T00:53:31.816Z","dependency_job_id":"98fcf124-3383-4fc4-8d1c-0c97218e3b27","html_url":"https://github.com/ericoporto/controlz","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoporto%2Fcontrolz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoporto%2Fcontrolz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoporto%2Fcontrolz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoporto%2Fcontrolz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericoporto","download_url":"https://codeload.github.com/ericoporto/controlz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243769985,"owners_count":20345217,"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":["adventure-game-studio","adventuregamestudio","ags","ags-script","gamepad","keyboard"],"created_at":"2024-11-21T15:05:09.993Z","updated_at":"2026-01-29T03:42:51.983Z","avatar_url":"https://github.com/ericoporto.png","language":"AGS Script","funding_links":["https://github.com/sponsors/ericoporto"],"categories":[],"sub_categories":[],"readme":"[size=18pt][b]Controlz[/b][/size]  [b][color=gray]0.4.0[/color][/b]\n[url=\"https://github.com/ericoporto/controlz/actions\"][img]https://github.com/ericoporto/controlz/actions/workflows/main.yml/badge.svg[/img][/url]\n[b][url=https://github.com/ericoporto/controlz/releases/download/v0.4.0/controlz.scm]controlz.scm[/url] | [url=https://github.com/ericoporto/controlz/releases/download/v0.4.0/controlz_demo_windows.zip]controlz_demo_windows.zip[/url] | [url=https://github.com/ericoporto/controlz]GitHub repo[/url]\n\nMove your character with keyboard or joystick controlz for Adventure Game Studio.\n\n[img]https://github.com/ericoporto/controlz/raw/master/controlz_demo.gif[/img]\n\nThis code was originally made by Dualnames for Strangeland and I eri0o got his permission to open source and wrapped in this function to be easier for consumption.\n\n[size=12pt][size=14pt][b]Usage example[/b][/size][/size]\n\nCall it on repeatedly execute, in your Global Script or in the script that you deal with player input, passing a character and some way to check for directional keys, once for each direction (down, left, right, up).\n\nIn the example below, WASD will be used to control the player character, and arrow keys will be used to control a second character named cEgo2. Since 0.3.0, solid characters collide with solid characters. Since 0.4.0, a character will keep walking in place if a button is pressed.\n\n[code=ags]\n// called on every game cycle, except when the game is blocked\nfunction repeatedly_execute() \n{\n  Controlz(player, \n    IsKeyPressed(eKeyDownArrow),\n    IsKeyPressed(eKeyLeftArrow), \n    IsKeyPressed(eKeyRightArrow),\n    IsKeyPressed(eKeyUpArrow));\n\n  Controlz(cEgo2, \n    IsKeyPressed(eKeyS),  IsKeyPressed(eKeyA), \n    IsKeyPressed(eKeyD),  IsKeyPressed(eKeyW));\n}\n[/code]\n\n[size=12pt][size=14pt][b]script API[/b][/size][/size]\n\nControlz only has a single function\n\n[size=12pt][font=courier]Controlz(Character* c, bool down, bool left, bool right, bool up)[/font][/size]\n\nCall it on your repeatedly execute or repeatedly execute always, passing a character and which keys are pressed at that time. If you need to control more characters, just call Controlz again, passing the new character and the buttons that are mapped to move it.\n\nYou can check for multiple keys or inputs too.\n\n[code=ags]\nfunction repeatedly_execute() \n{\n  Controlz(player, \n    IsKeyPressed(eKeyDownArrow) || IsKeyPressed(eKeyS),\n    IsKeyPressed(eKeyLeftArrow) || IsKeyPressed(eKeyA), \n    IsKeyPressed(eKeyRightArrow) || IsKeyPressed(eKeyD),\n    IsKeyPressed(eKeyUpArrow) || IsKeyPressed(eKeyW));\n}[/code]\n\n[size=12pt][size=14pt][b]License[/b][/size][/size]\n\nThis code is licensed with[url=https://github.com/ericoporto/controlz/blob/master/LICENSE] MIT LICENSE[/url].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericoporto%2Fcontrolz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericoporto%2Fcontrolz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericoporto%2Fcontrolz/lists"}