{"id":26198046,"url":"https://github.com/educ8s/pygame-collisions-example","last_synced_at":"2025-12-25T08:30:01.859Z","repository":{"id":242045759,"uuid":"808512014","full_name":"educ8s/Pygame-Collisions-Example","owner":"educ8s","description":"Collision detection in Pygame and Python. ","archived":false,"fork":false,"pushed_at":"2024-06-20T08:29:32.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T00:02:15.424Z","etag":null,"topics":["pygame","pygame-ce","pygame-tutorial"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/educ8s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-05-31T08:16:23.000Z","updated_at":"2024-06-20T08:29:36.000Z","dependencies_parsed_at":"2024-05-31T10:50:35.629Z","dependency_job_id":"15f22bb8-438c-47be-8ed9-16d65adcee8e","html_url":"https://github.com/educ8s/Pygame-Collisions-Example","commit_stats":null,"previous_names":["educ8s/pygame-collisions-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/educ8s%2FPygame-Collisions-Example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/educ8s%2FPygame-Collisions-Example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/educ8s%2FPygame-Collisions-Example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/educ8s%2FPygame-Collisions-Example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/educ8s","download_url":"https://codeload.github.com/educ8s/Pygame-Collisions-Example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243147265,"owners_count":20243745,"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":["pygame","pygame-ce","pygame-tutorial"],"created_at":"2025-03-12T02:49:48.148Z","updated_at":"2025-12-25T08:30:01.820Z","avatar_url":"https://github.com/educ8s.png","language":"Python","readme":"\n# Pygame Collisions Tutorial\n\nThis repository contains the code for a video tutorial on creating a simple collision detection system using Pygame in Python.\n\n\n# Video Tutorial\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"preview.jpg\" alt=\"\" width=\"940\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n🎥 \u003ca href=\"https://youtu.be/u35-y3OKj3o\"\u003eVideo Tutorial on YouTube\u003c/a\u003e\n\u003c/p\u003e\n\n\n## Overview\n\nIn this tutorial, we build a basic Pygame application that demonstrates collision detection between a player-controlled character (Dino) and an obstacle. The tutorial covers setting up the Pygame window, updating the character's position, detecting collisions, and visually representing the collision state.\n\n## Features\n\n- **Pygame Window Setup:** Initialize a Pygame window with a specified width and height.\n- **Dino Character:** A player-controlled character that can move and interact with obstacles.\n- **Obstacle:** A static rectangular obstacle positioned within the game window.\n- **Collision Detection:** Real-time detection of collisions between the Dino and the obstacle.\n- **Visual Feedback:** Visual representation of the obstacle and collision state.\n\n## Code Structure\n\n- **main.py:** The main script that initializes the Pygame window, handles events, updates the Dino's position, checks for collisions, and renders the game objects.\n- **dino.py:** A separate module containing the `Dino` class, which manages the character's position, rendering, movement, and collision detection.\n\n## How to Run\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/educ8s/pygame-collisions-tutorial.git\n   cd pygame-collisions-tutorial\n   ```\n\n2. Ensure you have Python and Pygame installed. You can install Pygame using pip:\n   ```bash\n   pip install pygame\n   ```\n\n3. Run the `main.py` script:\n   ```bash\n   python main.py\n   ```\n\n## Usage\n\n- Run the script and a window titled \"Pygame collisions\" will appear.\n- The `Dino` character can be moved using the arrow keys on the keyboard.\n- The obstacle is drawn as a black rectangle.\n- If a collision occurs, visual feedback will be provided.\n\n## Dependencies\n\n- Python 3.x\n- Pygame\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feduc8s%2Fpygame-collisions-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feduc8s%2Fpygame-collisions-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feduc8s%2Fpygame-collisions-example/lists"}