The Making of Fantasy Rampage
Idea by Trodoss
Code by Trodoss
Sunfire was inspired by non-vector space flight simulators such as Wing Commander. Some of the elements (the hand/flight stick adjusting with the movement) are a nod to elements in that series.
The gameplay shares elements with games such as Konami's Top Gun for the NES, where flight simulation was emulated in a sprite-based environment.
Simulating Yaw, Pitch, and Roll:
Fixed wing aircraft in flight move on three axises and their movements referred to as yaw, pitch, and roll (lateral, vertical, and longitudinal movement - see: https://en.wikipedia.org/wiki/Flight_dynamics)
To simulate this kind of motion in a non-vector, sprite-based game you can use background rotation and sprite adjustment. Games like Top Gun (Konami), After Burner (Sega), and Wing Commander (Origin) used techniques like these to simulate flight.
Rotating the background (Yaw, Roll):
In Sunfire, the background is made up of a series of horizontal strips (8 x 32 pixels) that are being adjusted vertically based on the roll.
If you move left, for example, the strips will shift down on the left side of the screen, and up on the right side of the screen to make it look like the ship is banking. The background also moves right in this case to simulate the yaw.
When the ship moves, the other elements in the game are adjusted relative to the motion. So, for example, if you move the ship left, the elements will be shifted right.
The following is an excerpt from the adjustment code:
if (pitch > 0)
//steep pitch - pitch directly affects
//the element's x position
if (pitch > 3)
//shallow pitch - pitch affects
//the element's x position less often
if ( element.counter % 2 == 0)
You will also notice that enemy ships will change the image to be relative to the center of the center of the screen. This is done to give the enemies a relative position to the ship to provide a more realistic (pseudo 3D) look.
You will also notice the random space debris in the game. This is to simulate movement in the game. The debris will start at the center point of the screen and move out towards the edges.