{"id":25371119,"url":"https://github.com/c70sp/asteroidsclone","last_synced_at":"2025-04-09T08:24:16.993Z","repository":{"id":262812010,"uuid":"884883983","full_name":"c70sp/AsteroidsClone","owner":"c70sp","description":"Little Asteroids clone I made from scratch, not supposed to be a 1:1 copy, but rather just be similar and fun","archived":false,"fork":false,"pushed_at":"2024-11-14T13:42:33.000Z","size":55,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T02:33:11.152Z","etag":null,"topics":["asteroids","asteroids-clone","asteroids-game","games","js","oop","vanilla-javascript","vanilla-js"],"latest_commit_sha":null,"homepage":"","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/c70sp.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":"2024-11-07T15:02:27.000Z","updated_at":"2024-11-25T13:20:15.000Z","dependencies_parsed_at":"2024-11-19T21:46:33.447Z","dependency_job_id":null,"html_url":"https://github.com/c70sp/AsteroidsClone","commit_stats":null,"previous_names":["c70sp/asteroidsclone"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c70sp%2FAsteroidsClone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c70sp%2FAsteroidsClone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c70sp%2FAsteroidsClone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c70sp%2FAsteroidsClone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c70sp","download_url":"https://codeload.github.com/c70sp/AsteroidsClone/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248001171,"owners_count":21031366,"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":["asteroids","asteroids-clone","asteroids-game","games","js","oop","vanilla-javascript","vanilla-js"],"created_at":"2025-02-15T02:31:21.771Z","updated_at":"2025-04-09T08:24:16.973Z","avatar_url":"https://github.com/c70sp.png","language":"JavaScript","readme":"# Small and dynamic Asteroids clone\n\nArrow left / right to turn\u003cbr\u003e\nArrow up / down to accelerate\u003cbr\u003e\nSpacebar to shoot\u003cbr\u003e\nEnter to reset\u003cbr\u003e\n\nThe asteroids and the spaceship are fully customizable via objects/asteroids.js and objects/spaceship.js respectively\u003cbr\u003e\n\n## Asteroid generation\n\n\u003cimg src=\"img/asteroidGen.png\"\u003e\n\n\u003e Asteroids are generated by first creating a circle with a radius defined by `rad`.\u003cbr\u003e\n\u003e Around this circle, `amountPoints` are evenly distributed.\u003cbr\u003e\n\u003e From each of these points, a line is drawn towards the center of the circle (illustrated as an orange line) with a length of `vecLength` and an inset of `vecInset`.\u003cbr\u003e\n\u003e Each line is then rotated within a range of ±`maxAngle` degrees (for example, a max angle of 45° would allow for a rotation between 45° clockwise and 45° counterclockwise), resulting in the final orientation of each line (shown as the green line).\u003cbr\u003e\n\u003e Between the endpoints of these rotated lines, the final points (shown as red points) will be generated, which are connected with line segments to form the irregular shape of the asteroid.\u003cbr\u003e\n\u003e For now the collision detection is just based on the circle.\u003cbr\u003e\u003cbr\u003e\n\u003e These different lines and points can be shown by changing this.display in js/objects/asteroid.js","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc70sp%2Fasteroidsclone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc70sp%2Fasteroidsclone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc70sp%2Fasteroidsclone/lists"}