Shooters are one of the best places to start when making games. Most people like to play a shooter, so they are a recognizable game archetype. The best part is that they are generally easy to make. So let's construct one!
In this chapter, we are going to learn:
Once you have started a new project, you need to change the layout size to 640, 480
. Then, we need to add some art. The first thing we need to add is the player. Find a circular graphic and add the sprite. Make your sprite 50 by 50 pixels and change its name to Player
.
Your layout should look like the following screenshot:
It's really important that you name the player as well as set the size, because when you make a lot of sprites, it can get confusing later on. Imagine if you had a game with 200 sprites and they were all called sprite1, sprite2, and so on; it would get confusing really fast. Whenever you set the size of an object, it is best to set the size in Photoshop or another program. When you change the size of images in game engines, the images can be distorted and as a result, they do not look good.
The next thing we need to do is create a background. In order to do this, we need to add another layer to the game. This can be done by performing the following steps:
This will create a new layer on top of the other layer. Move Layer 1 to the bottom; to do this, select Layer 1 and press the down arrow.
Layer 1 is now at the bottom and we can add our background image. While you do not need to have a background image, it is good practice to put one in because most games have them. Also, it improves the quality of the game. Add the background image. At this point, we need to change the background transparency. Currently, you have something like the following screenshot:
The top layer should now be transparent and you can see the background.
Now, we have two layers and we can start programming some of the game mechanics. We have two layers, but we will need to add more as the game goes on.
3.144.17.128