Close

Asteroids #3 - Movement

A project log for Merlin

68000 Retro Super Computer

matthew-pearceMatthew Pearce 02/11/2022 at 14:080 Comments

So, having created the shapes for the asteroids, ufo and player ship. It's time to move them about. The number of asteroids will be governed by the level - I've set to 5 at the moment. The starting position (x,y), heading in furmans and speed for the asteroids are set randomly.

At the moment the ship and ufo are moving perpendicular to each other. A polar conversion routine using sin/cos is used to translate the velocity and heading into cartesian coordinates. The GD library provides lookup functions for this purpose.

Code will be available here:

https://github.com/mattuna15/merlin-software/blob/master/asteroids/asteroids.s

Discussions