GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - RVZO6/Asteroids-Java: A recreation (with some personal additions) of the original Atari game Asteroids released in 1979.

This repository was archived by the owner on Jan 15, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
out/production/Asteroids_RP4K/Sounds
out/production/Asteroids_RP4K/Sounds
 
 
src
src
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
Asteroids_RP4K.iml
Asteroids_RP4K.iml
 
 
Game Over.png
Game Over.png
 
 
Gameplay.png
Gameplay.png
 
 
Get Ready.png
Get Ready.png
 
 
Multishot.svg
Multishot.svg
 
 
README.md
README.md
 
 
Trig.svg
Trig.svg
 
 
Upgrade.png
Upgrade.png
 
 

Repository files navigation

Asteroids

This project is a recreation (with some personal additions) of the original Atari game Asteroids released in 1979.

Key Features:

Multishot

I first defined totalMultishotAngle as the range that the multishot bullets were to be fired and dispersed at, and multishotLevel as, well, the multishot level.

I then define multishotDivisions as 2 + multishotLevel * 2. The "2+" is to have a base multishot level and each multishot level adds two more bullets (to balance on each side), thus times 2.

Then, I iterate through multishot divisions (i <= multishotDivisions) and use this formula to calculate the angle:

rotatedAngle = angle + totalMultishotAngle/2 - (totalMultishotAngle/multishotDivisions * i)

This diagram explains what is happening in the formula:

Multishot.svg

Movement and Rotation

Logic:

I used trigonometry to calculate the X and Y speeds depending on a angle value and a "thrust" value.

Trig.svg

Rendering:

I used the rotation matrix to rotate the points making up the shape of the ship, which is then rendered.

$$ \begin{bmatrix} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \\ \end{bmatrix} $$

This can be expressed in (pseudo) code as:

rotatedX = x * cos(angle) - y * sin(angle);
rotatedY = x * sin(angle) + y * cos(angle);

Key Concepts:

  • Trigonometry
  • Interfaces
  • Object-Oriented Programming
  • Matrices

Pictures:

Get Ready.png Gameplay.png Upgrade.png Game Over.png

About

A recreation (with some personal additions) of the original Atari game Asteroids released in 1979.

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.