All four Levels!

Just a quick post here, just to show off some of the completed background graphics for the game!

 

Level 1

level1

 

Level 2

level2

 

Level 3

level3

 

Level 4

level4

Advertisements

99% Done

So that’s the game well past the 99% mark. Now, all that needs to be done is some polishing graphical touches, notably the Main Menu and Credits, which I’m assured will be done by tomorrow. Overall, I feel the game’s a success. Not only is it pretty and very nice portfolio piece, it’s actually pretty fun to play! I worked very hard on the player controls to get them smooth, and spent days working out formulas for acceleration and deceleration. But finally, it’s almost over. Once it’s 100% done, I’ll do a more reflective post, detailing what I’ve learned about Programming, Game Design and general Project Management. For now, I’ll list most of the features of the game and talk a little in depth about them.

 

Main Menu

First of all, the game features a Main Menu. While very basic looking now, this will have some treatment in a few days to pretty it up! There are four button’s on the main menu, all fairly self explanatory. When the mouse is hovered over one of the buttons, the buttons light up (Play is lit up in the screenshot). This was done with a simple animation sheet, containing two nearly identical images. The first one was the button darkened, the second was lightened. Then the game switches between them when the mouse coordinates collide with the button, it’s as simple as that!

Loading was done very simply. Basically, during gameplay, if the user pressed S then the player’s current level, score, and position, are saved to a .txt file. When load is clicked, this data is loaded in and the user started from where they left off. Very simply done, yet I’ve not had a problem with it. And, because it’s so simple, there’s very little that can go wrong with it!

MainMenu

 

Scoreboard

Next, I’ll talk about the scoreboard. The scoreboard reads in it’s data from a .txt file of saved data, which looks like this.

scores

Then the data is read in from the program, and rearranged by score size (just to avoid any glitches). If the player’s score is greater than the smallest score, then they’re prompted to enter their name into a separate window. Once they hit enter, their name will appear on the scoreboard, which will change the data in the .txt file to the new scores.

scoreboard1

scoreboard2

 

Main Game

The main game is made up of three parts, from a programming perspective. I divided them up for my own sake, so I’d know changing one part wouldn’t mess up everything else. It’s the Initialization class, GameLogic class, and Rendering class.

The initialization simply loads everything in the game, mostly from .txt files. Everything that’s loaded is outputted to the console, which is good so I can see which parts take longest to load, as well as, when the game crashes, what the last message outputted was. Since every game objects data is stored in a .txt file, I only load them in once, at the start. Then I load in level data, which is simple object positions. Then, when changing levels, I reset every Entity’s position then load in new ones from a different .txt file. Since I only load in positions, and not data, changing level is very fast compared to the initial loading.

initialization

 

The GameLogic class actually does very little itself, instead delegating work out to even more classes. The Player’s Animation and Controls are separate classes, as well as most Collisions. The only thing it really handles is the shooting for the player and enemies, and that’s only because I was rushing them a bit to get them done and didn’t create class for them (though I really should have). They do, however, have structs holding data so creating a class shouldn’t take too long, if I ever get around to doing it…

screen2

 

Now, the Rendering. That’s one of the thing’s I’m most proud of, and something I haven’t touched since the start of the summer. Basically, every object is passed into the Renderer upon creation. In there, the Renderer sorts them by their Depth value, drawing objects with a lower depth first. That’s it really, and it’s worked so well I haven’t had to touch it for most of the summer!

screen1

 

Now, the secret, forth part, the level editor. While technically a part of the Main Game, it’s never touched by the User. Yet I’m very proud of it and thought it deserved a mention. Basically, upon pressing CTRL, the User will reset every Entity’s position and a menu will be brought up for placing objects. They can scroll left and right through the level, place and delete objects, and save all their changes to the Level’s .txt file.

construction

 

I’ll do another blog post within the next day or two, detailing what I’ve learned from making this game, as well as a link to a Dropbox downloadable version of the game itself.

Enemy Sprites

So that’s my artist, Lauren Martin (deviantART, tumblr), done 5 out of the 6 enemy sprites, and they look good! Below are the screenshots showcasing the 5 complete enemies, and although only two have been animated, I’ve been told that the animation for them all should only take a few days now.

enemy1

enemy2

enemy45

e3

 

Since the .png’s are 128×128 but the image doesn’t touch the walls, I made custom collision boxes. These lock onto the objects position, but their size is independent, and are use for collision detection. Here’s a quick screenshot to give you an idea what they’re like.

mask

Animation

So, that’s the Player is finally animated! I only got the Sprite Sheet a few hours ago, and already it’s done! While we may add a few extra animations on (assuming we’ve time), that’s the majority done!

We’ve got 7 animations for the player, all rolled into one VERY long Sprite Sheet (it’s 3072 pixels wide!) with animations for: Normal Flight, Normal to Down, Down, Down to Normal, Normal to Up, Up, and Up to Normal. The data for each animation is loaded from a (slightly clunky) .txt file, which you can see below. Each animation requires a Title, the Start and End Frames within the Sprite Sheet, and the Speed it’s played at.

animation

As you can see, the .txt file is very clunky. And while making it tidier is something I’d like to work on, it’s not very high on my priority list since I’m the only one looking at it. The Enemy’s, which generally only have a Normal animation, have much simpler looking .txt files.

 

Here’s three screenshots, showing the player’s Up, Normal, and Down animations!

up

normal

down

 

There’s not much left to do in the game. There’s a pretty severe glitch where the Boss’s bullets disappear randomly, and another with an Enemy’s movement pattern. I’ve also still not fixed the glitch with the scoring resetting between levels. I also need to change the player’s collision box size, since right now it’s actually larger than the plane! Apart from those glitches, and a lack of levels, the game’s more-or-less done and I’m in the Polishing-And-Making-Pretty stage!

I have plans to add a download link to the game in just over a week, once the game’s closer to my own person standards!

Update

Sorry for the lack of updates recently. I’ve still been working on the game, however. I’ve done 90% of it, just need to create a couple of levels (which should only take an hour or so) and implement the animations and graphics when they’re done (which will be slightly trickier).

Now, for what I’ve actually done. The first thing is change the resolution, which was much easier than I thought it’d be. Originally, the game was 800×600, but this screen size meant the player didn’t have much room to move once I’d increased the graphics size. So, it was changed to 1024×768, which allowed for larger and clearer graphics, while still providing enough room for the player to actually dodge enemies.

screenshot

The next thing you’ll notice, is the player sprite is done (almost). The animation sheet for it is actually done too, but my artist, Lauren Martin (tumblr, deviantART) hasn’t added the character onto the plane yet, so the animation hasn’t been implemented. However, we’ve got animation for: Going Up, Going Down, Flying Forward and many more. I’ve seen them in action, and they’re pretty spectacular!

The last thing was a complete rework of the level system. While the old level system was good, it was difficult to save level’s I’d created for backup reasons. Originally, each level’s data was saved to the entity’s themselves. So the player’s initial position for level1 was saved to the player, and for level2, and so on. It was the same for enemies, and if a level has more, or less, objects than another then the objects were deleted or created as needs be. This system was very fast (after the initial loading), but it just didn’t work very well in practice. So, choosing easy-to-read over speed, I changed this completely. Now each level loads in once the previous one’s done. It takes a few seconds to load, but the system’s so much easier now than before. Now level’s are their own .txt file, each storing only the initial position for each objects. Here’s a scaled-down version of level1’s .txt file to give you an idea (in reality, each level’s a few hundred lines big).level example

There are still a few glitches in the game. When going to a new level, the player’s score will go back to what it was at the last checkpoint, bullets randomly disappear (and occasionally appear), and sometimes the loading screen doesn’t appear properly. These, and about a million more, are the glitches I’m going to be tackling over the next few weeks!