Share your repls and programming experiences

← Back to all posts
Asteroids
remarkablemark (25)

Asteroids

Asteroids game from p5.play example.

The original game was broken so I made improvements. See repository.

Changelog

Bug Fixes

  • Decrease ship and particle friction so they can move
  • Improve text readability by giving it a stroke and putting it in front of the layers

Features

  • Render the game full screen
  • Generate asteroids based on screen size
  • Destroy the ship on asteroid collision
  • Improve bounding box collision detection
  • Improve ship speed
  • Randomize the speed of sprites (asteroids and particles)
  • Control ship using arrow keys or WAD; fire bullet with space

Chore

  • Refactor to local scope so globals aren't polluted