Tag: SDL

Spacefight – Packing all the resources into one file – Part 10

While the project is in development phase it is very convenient to have all the assets laying around in folders. But when it’s time to distribute your game it doesn’t look as professional when everything is lying all over the

Posted in Game programming Tagged with: , , , , , ,

Spacefight – Sound and music – Part 9

One of the most overlooked things when you create your first game, is the sound. For me, the sound really makes a game come to life. I can just look back to when I was a kid. I could play

Posted in Game programming Tagged with: , , , , , , ,

Spacefight – The game-loop – Part 6

All games contain loops of some sort. The most important loop in the game is simply called “game-loop”. This is a short example how it will run:

This is a short version of what is happening in the code.

Posted in Game programming Tagged with: , , , ,

Spacefight – Subclassing into enemies, player and other stuff – part 5

In the last post I made a GameObject class. Now it’s time to subclass from the GameObject class into an enemy. The enemy object will make use of the shared functionality in GameObject, like position, access to a shared AnimationLibrary

Posted in Game programming Tagged with: , ,

Spacefight – The GameObject – part 4

A lot of objects in the game has a many things in common. They contain an Animationlibrary, a position on the screen, width and height. They also got common functions like: Listen Sends any event from the user’s keyboard/mouse/joystick to

Posted in Game programming Tagged with: , , ,

Spacefight – Sprites and animations – part 3

Sprites. The small animated objects are essential to a 2D game. My game will contain quite a number of sprites like enemies, bullets and of course the the player. There are different approaches how to arrange your sprites. Some developers

Posted in Game programming Tagged with: , , ,

Spacefight – Getting familiar with SDL – part 2

SDL 1.2 is a pretty easy library to learn. One web site I cannot more than recommend is Lazy Foo’s SDL tutorials. It’s the best starting point if you’re new to SDL. The tutorials go through a lot of important

Posted in Game programming Tagged with: , , , ,

Spacefight – A game from the ground up – part 1

About 20 years ago, I had a desire to create my own game. At that time I had some basic programming skills, but I was still very much a beginner. With no clue about how to make a game. In

Posted in Game programming Tagged with: , , ,