Hi there!, ready for more 2D shoot ’em up making? Good, let’s continue from where we left off last time.
As you know, we finally had a way to load tiled levels and populate them with walls, destroyable blocks and some enemies. That’s great, but we need to be able to slowly scroll the level to the right, or our ship won’t be able to actually get anywhere.
On top of that, we need to build a collision system so we can collide objects between each other, and to be able to keep the player inside the game stage bounds. And those two things are exactly what we are going to do today. Let’s rock!
Let’s pick up right from we left things last time. We finally had our “ship” moving around and being able to shoot bullets, right?
That’s great, but now it’s the time to set up a way to load tiled levels and even more, we need at least one level to be able to test everything out!
We will fix that right away, but to do so we need to use a new tool to build our level.
Introducing Tiled editor
Tiled is a simple tilemap level editor. You can use its simple graphic interface to place tiles around, set up different objects and group them inside various layers. It’s really easy to use and you’ll get the hang of it in no time.
Download Tiled fro its website and fire it up. Select File -> new and create an orthogonal tiled level with 32×32 tile size and with a width of 100 tiles by a height of 15 tiles (this will fit the full height of our set up screen, because our vertical resolution is 480 = 15*32).
Creating our new test map
Hello there!, today we are going to go straight to business by starting with the first stage of a multi-part tutorial on how to build a simple -yet very illustrative- game using the wonderful HaxeFlixel framework <3
The idea here is rather simple. We are going to create the skeleton of a 2D horizontal space shooter game, in the style of Gradius, R-Type or Thunder Force. You know the drill. But you probably have already seen lots of tutorials on teaching how to do something similar. Problem is, most of those tutorials show you how to build a game where there is no actual scenario or pattern to the game. Probably they just generate enemies and obstacles in a random way, and leave you with the simple goal of surviving and ranking up as many points as you can.
Having customized scenarios and accurate enemy placement really bring these games to life
That’s ok and really nice, but I want to give this tutorial a twist, and for that we are going to lay the groundwork for you to build a space shooter that you will be able to expand on. We are going to have custom levels that you will be able to design freely in a level editor, without having to touch a single line a code.
Are you up for it?, let’s get started then!
Building a game is hard work, we all know that. On this tough process you are going to need any help you can get, and for this reason you have to do yourself a favour and use the right tools for the job.
By tools I mean, of course, a proper game engine or framework that suits your needs.
Yeah, yeah, I know what you are thinking: “but I’m a pro!, I don’t need nobody’s help on this!, I will build my own game engine from scratch, and it will completely rock the competition!”. Ok, that may be the case for you, Mr genius programmer, but for the rest of us mortals we can do fine by getting along using some of the best frameworks and game engines the great minds in the industry have developed and refined for us to use. You can keep your custom-made-and-slow-as-@$#* engine for yourself. Good luck with it.
Hey, I’m sorry, I didn’t want to be that rough with you. Come along, we are going to review a few things you may want to have in mind when choosing the engine that will make your dream game come true. Let’s roll.