{"id":20864629,"url":"https://github.com/wonder-tree/spaceshooter-posecamera","last_synced_at":"2026-04-19T21:35:23.953Z","repository":{"id":178812905,"uuid":"350981490","full_name":"Wonder-Tree/SpaceShooter-PoseCamera","owner":"Wonder-Tree","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-27T08:05:51.000Z","size":4161,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-12T15:12:44.301Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Wonder-Tree.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":"2021-03-24T07:13:48.000Z","updated_at":"2021-04-27T08:05:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"30c1c1ca-a032-4b3e-818b-6c0576a1adb4","html_url":"https://github.com/Wonder-Tree/SpaceShooter-PoseCamera","commit_stats":null,"previous_names":["wonder-tree/spaceshooter-posecamera"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Wonder-Tree/SpaceShooter-PoseCamera","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wonder-Tree%2FSpaceShooter-PoseCamera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wonder-Tree%2FSpaceShooter-PoseCamera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wonder-Tree%2FSpaceShooter-PoseCamera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wonder-Tree%2FSpaceShooter-PoseCamera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wonder-Tree","download_url":"https://codeload.github.com/Wonder-Tree/SpaceShooter-PoseCamera/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wonder-Tree%2FSpaceShooter-PoseCamera/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28038949,"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","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-18T05:43:33.811Z","updated_at":"2025-12-25T22:19:44.929Z","avatar_url":"https://github.com/Wonder-Tree.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build](https://github.com/Wonder-Tree/SpaceShooter-PoseCamera/actions/workflows/main.yml/badge.svg)\n  [![CodeFactor](https://www.codefactor.io/repository/github/wonder-tree/SpaceShooter-PoseCamera/badge/main?s=2f1b8e81d87a77838e2747d77df1c942b1259636)](https://www.codefactor.io/repository/github/wonder-tree/SpaceShooter-PoseCamera/overview/main)\n\n\n\n## Space Shooter\nSimple game in which you have to have to shoot meteoroids with you space craft and avoid meteoroids by moving left and right on your screen. Game uses our **PoseCamera** sdk to detect human body from webcam and controll space craft movement.\n\nyou can learn more about PoseCamera SDK on this link : https://github.com/Wonder-Tree/PoseCamera\n\n### How to build\ninstall requirements by running following command\n```\npip install requirements.txt\n```\nand then start the game `python main.py`\n\n### Science behind the game\nThe spaceship position is controlled by the following code in the game\n```python\npose = self.camera.poses[0]\n# Get left hip and right hip positon\nr_hip = pose.keypoints[8]\nl_hip = pose.keypoints[11]\n                \n# and find center\ncenter = (\n    (l_hip[0] + r_hip[0]) // 2, \n    (l_hip[1] + r_hip[1]) // 2\n          )\n\n# Set position \nself.player.rect.x = center[0]\n```\n\nThe following lines of code is used to spawn the bullets\n```python\n# Bullet spawn gesture\n# if right or left hand is above neck\nneck = pose.keypoints[1]\n# Get left and right wrist positions\nr_wrist = pose.keypoints[4]\nl_wrist = pose.keypoints[7]\n\nif r_wrist[1] \u003c neck[1] or l_wrist[1] \u003c neck[1]:\n  self.shoot = True\nelse:\n  self.shoot = False\n```\n\n![Sampel output](output.gif)\n\n## How to play\nFollow 3 easy steps to play the game\n1. Stand in the front of your laptop/pc webcam at atleast 4 feet distance. Make sure your hips are visible on the camera.\n2. Move your body left and right to move space craft, space craft is attached to your horizontal body movements\n3. To start shooting pull your right hand up, space craft will start shooting.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwonder-tree%2Fspaceshooter-posecamera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwonder-tree%2Fspaceshooter-posecamera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwonder-tree%2Fspaceshooter-posecamera/lists"}