Empty Your Mind Tutorial 3

This tutorial will teach you how to use the SwinGameSDK to develop a simple danmaku game which looks cool. At the end of this tutorial you should be able to use pascal to implement your own space invaders or scrolling shooter style game which makes use of Vectors, animated Sprites, SoundEffects, and Music.

Preparing The Background Sprites
Background image in a scrolling shooter game is very important. I want a single seamless image scrolling in the game we will be making. I will be using [[Media:Map1.jpg|this]] image in this tutorial. To create a scrolling effect, we will need to setup two sprites. This will be explained later in this tutorial. The following code should go into your LoadGame procedure. As you can see, we are creating sprites and adding it to the list of images. We will be using this array of bitmap to manage images such as HUD. This will create two sprites which contains the same image. Do not forget to set the length of the images array.

Drawing The Background
The following steps must be taken to draw the seamless background. The implementation of the steps:
 * Move the Sprite 1 (10 pixel down)
 * Check if the Sprite 1 has disappeared from the screen
 * If the Sprite 1 is off the screen, reset the position of the Sprite 1 (i.e. set the coordinate to 0, 0)
 * Move the Sprite 2 on the Sprite 1 (therefore, the bottom of the Sprite 2 will attach to the top of the Sprite 1)
 * Draw Sprite 1
 * Draw Sprite 2

Summary
In this tutorial, I have gone through: The current project files can be downloaded from [[Media:EYM_11_02.zip|here]].
 * The algorithm to scroll the background