{"id":20299856,"url":"https://github.com/python-ninja-hebi/python-pygame-ping","last_synced_at":"2025-10-07T02:39:22.132Z","repository":{"id":178032483,"uuid":"579940505","full_name":"Python-Ninja-Hebi/python-pygame-ping","owner":"Python-Ninja-Hebi","description":"Simple Table Tennis Game with Python and Pygame","archived":false,"fork":false,"pushed_at":"2023-04-17T13:47:25.000Z","size":1642,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-14T10:33:37.815Z","etag":null,"topics":["game","game-development","pygame","python"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/Python-Ninja-Hebi.png","metadata":{"files":{"readme":"README.ipynb","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":"2022-12-19T10:20:41.000Z","updated_at":"2023-05-26T22:46:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"b162a1e1-0038-4390-98f7-dbf78486ee2b","html_url":"https://github.com/Python-Ninja-Hebi/python-pygame-ping","commit_stats":null,"previous_names":["python-ninja-hebi/python-pygame-ping"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Python-Ninja-Hebi%2Fpython-pygame-ping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Python-Ninja-Hebi%2Fpython-pygame-ping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Python-Ninja-Hebi%2Fpython-pygame-ping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Python-Ninja-Hebi%2Fpython-pygame-ping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Python-Ninja-Hebi","download_url":"https://codeload.github.com/Python-Ninja-Hebi/python-pygame-ping/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241795063,"owners_count":20021386,"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":["game","game-development","pygame","python"],"created_at":"2024-11-14T16:16:33.595Z","updated_at":"2025-10-07T02:39:17.096Z","avatar_url":"https://github.com/Python-Ninja-Hebi.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"f4169895-9110-4d6a-8552-3ee0d49d8270\",\n   \"metadata\": {},\n   \"source\": [\n    \"# pygame-ping - simple ball game with python and pygame\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"e5363834-a363-4313-9ba8-73a15855c68a\",\n   \"metadata\": {},\n   \"source\": [\n    \"I made a simple game with python and pygame\\n\",\n    \"\\n\",\n    \"A classic table tennis game\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"1a3ce75c-ed7c-483f-a295-716fc6205037\",\n   \"metadata\": {},\n   \"source\": [\n    \"\u003cimg src=\\\"img/step1.gif\\\" width=\\\"320\\\" align=\\\"left\\\"\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"2106a9bb-7055-4725-a2f7-cc06c3c70dbe\",\n   \"metadata\": {},\n   \"source\": [\n    \"## From pygame to the browser\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"3dd18b8a-beff-4a4d-b217-379350c7c46f\",\n   \"metadata\": {},\n   \"source\": [\n    \"You can convert a python pygame into an webassembly and play it in the browser.\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"e629058f-b87d-4baf-8c83-12b7448a9d37\",\n   \"metadata\": {},\n   \"source\": [\n    \"Install pygbag https://github.com/pygame-web/pygbag\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"df33cbec-11d4-4fbb-bbdf-8a764682db3d\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"pip install pygbag\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"a04bb914-82c6-4eb1-8665-b5f14738a63d\",\n   \"metadata\": {},\n   \"source\": [\n    \"You have to rename your game to main.py and make its loop async aware.\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"e748e315-fb25-40c2-9c6e-9338fcf06c31\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import pygame, asyncio\\n\",\n    \"\\n\",\n    \"FRAMES_PER_SECOND = 30\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"class Ping:\\n\",\n    \"...\\n\",\n    \"\\n\",\n    \"    async def game_loop(self):\\n\",\n    \"        while True:\\n\",\n    \"            for event in pygame.event.get():\\n\",\n    \"                if (event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE) \\\\\\n\",\n    \"                        or (event.type == pygame.QUIT):\\n\",\n    \"                    return\\n\",\n    \"\\n\",\n    \"            self.update()\\n\",\n    \"            self.draw()\\n\",\n    \"            await asyncio.sleep(0)\\n\",\n    \"\\n\",\n    \"...\\n\",\n    \"\\n\",\n    \"async def main():\\n\",\n    \"    ping = Ping()\\n\",\n    \"    await ping.game_loop()\\n\",\n    \"\\n\",\n    \"asyncio.run(main())\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"359968c1-1422-4ddc-984e-3adae372d63e\",\n   \"metadata\": {},\n   \"source\": [\n    \"Compile to webassembly\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"4dae1af5-5436-4e06-a917-b9cc592e598d\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"pygbag ./folder\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"50e49198-d3f6-406d-b08d-334ba26eac81\",\n   \"metadata\": {},\n   \"source\": [\n    \"You can play it.\\n\",\n    \"Chrome should work. Use keyboard.\\n\",\n    \"\\n\",\n    \"https://hebi-python-ninja.itch.io/ping-from-pygame-to-the-web\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"5c775a9e-bae4-4c99-86ad-1d5d6e294421\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": []\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Rust\",\n   \"language\": \"rust\",\n   \"name\": \"rust\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": \"rust\",\n   \"file_extension\": \".rs\",\n   \"mimetype\": \"text/rust\",\n   \"name\": \"Rust\",\n   \"pygment_lexer\": \"rust\",\n   \"version\": \"\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-ninja-hebi%2Fpython-pygame-ping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-ninja-hebi%2Fpython-pygame-ping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-ninja-hebi%2Fpython-pygame-ping/lists"}