{"id":32070728,"url":"https://github.com/uba/bounce","last_synced_at":"2026-07-14T02:32:28.265Z","repository":{"id":293739496,"uuid":"498852129","full_name":"uba/bounce","owner":"uba","description":"⚪ Bounce Game - avoid the enemies to keep the white ball bouncing.","archived":false,"fork":false,"pushed_at":"2025-05-16T21:24:34.000Z","size":5953,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-19T15:59:34.896Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://uba.github.io/bounce/","language":"JavaScript","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/uba.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,"zenodo":null}},"created_at":"2022-06-01T18:22:38.000Z","updated_at":"2025-05-16T21:24:37.000Z","dependencies_parsed_at":"2025-05-16T22:27:16.033Z","dependency_job_id":"4aa37f9a-6a83-469d-9e50-e667f838b37b","html_url":"https://github.com/uba/bounce","commit_stats":null,"previous_names":["uba/bounce"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/uba/bounce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uba%2Fbounce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uba%2Fbounce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uba%2Fbounce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uba%2Fbounce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uba","download_url":"https://codeload.github.com/uba/bounce/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uba%2Fbounce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35443979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-14T02:00:06.603Z","response_time":114,"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":"2025-10-19T04:33:54.773Z","updated_at":"2026-07-14T02:32:28.260Z","avatar_url":"https://github.com/uba.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bounce \nPlay ➡️ \u003ca href=\"https://uba.github.io/bounce\" target=\"_blank\"\u003ehere!\u003c/a\u003e\n\n✨ Inspired by the idea of Daniel Barral (UFJF/2003) and the work of Hakim El Hattab (https://hakim.se/).\n\n*\"Games shouldn't only be fun. They should teach or spark an interest in other things.\" — Hideo Kojima*\n\n... including how they are made. 🧑🏻‍💻\n\nhttps://github.com/user-attachments/assets/ff8c8392-756e-402e-b16d-6a91ef57f1b2\n\n# ChatGPT description based on the [bounce.js](js/bounce.js) code\n\nThis JavaScript code defines the main logic of a browser-based game called **Bounce**.\n\nIt's a simple 2D arcade-style game that involves a bouncing ball (the player) avoiding enemies while earning points.\n\n## 🕹️ Game Overview\n\n- You control a **bouncing ball** (player).\n- The ball moves up and down using a **quadratic function** (a parabola) to simulate bouncing.\n- You can move the ball **left or right** using the arrow keys or touch controls (on mobile).\n- The goal is to **avoid enemies** (other moving balls).\n- **Colliding with an enemy** ends the game.\n- You earn points for each **successful bounce** off the bottom of the screen.\n- **Special effects** like particles and sound effects provide feedback.\n\n## 🧠 Core Logic\n\n### 🎮 Game Loop\n\nThe game runs inside a `requestAnimationFrame` loop (update function), which redraws the screen every frame. In each frame:\n\n- The game clears and redraws the canvas.\n- The player and enemies are updated and rendered.\n- Particles and notifications are animated.\n- **Collision detection** is performed.\n\n### 🧮 Movement\n\n- The **vertical motion** of the player is modeled using a **quadratic function** to simulate bouncing (y = ax² + bx + c).\n- The **horizontal motion** is controlled by player input (keyboard or touch).\n\n### 👾 Enemies\n\n- Enemies move **horizontally** and bounce off the screen edges.\n- Each time they hit an edge, they **accelerate slightly**.\n\n### 💥 Collision Detection\n\n- If the player ball intersects with an enemy ball, a **particle explosion** occurs, a \"dead\" sound plays, and the game ends.\n\n### 🔊 Sound Effects\n\n- Uses the **Howler.js** library to play sounds.\n- Includes **background music** and effects for actions like bouncing, starting the game, and collisions.\n- A **sound toggle button** allows muting/unmuting.\n\n### 📱 Mobile Support\n\n- The game detects if it's being played on a **mobile device**.\n- On mobile, **left/right buttons** are shown on-screen to control the player.\n\n### 🧩 Entities\n\n- **Ball**: Represents both the player and enemies.\n- **Particle**: Small squares emitted on collisions or actions for visual effect.\n- **Notification**: Text messages that float up for scores and bonuses.\n\n### 🎨 Graphics\n\n- Uses the **Canvas API** to render the game.\n- Balls are drawn with **gradients and shadows**.\n- Particles and score messages **fade out** over time.\n\n### 💾 Score and High Score\n\n- The **current score** increases with each bounce.\n- Every **10 points**, a notification and special effect trigger.\n- **High scores** are saved using the browser's `localStorage`.\n\n### 🚀 Initialization\n\n- Sounds are **preloaded** before the game starts.\n- Once loaded, the **menu fades in** and waits for player input.\n\n### 📐 Resizing\n\n- The game **dynamically adjusts** to screen size, especially for mobile.\n\n### 🧪 Utility Functions\n\n- **isMobile()** detects mobile devices.\n- **getRandomColor()** generates a random RGB color.\n- **Point** and **Entity** are basic geometry helpers.\n\nIn summary, this is a polished, interactive bouncing-ball game with sound effects, animations, and mobile compatibility — inspired by classic arcade games, built for modern browsers using JavaScript and HTML5 Canvas.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuba%2Fbounce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuba%2Fbounce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuba%2Fbounce/lists"}