Category: ‘Game Development’

Animating Sprites In An Infested Kitchen

July 25, 2023 Posted by zachary

It has been a long time since my last update and I am happy to be back. I have been working on this game for a while. I started it nearly a year ago and life kind of got in the way.

In chapter 14 of Beginning Game Programming, we are challenged to make a gallery style shooter. The game in the book is an office battle game, but I didn’t feel that such a setting was appropriate for us. So I changed the theme to a game about killing bugs in a kitchen.

In Chapter 15, the book teaches us about animating sprites. Since we already used animated sprites in previous games, I combined the two chapters. But I also decided to use something we touched earlier in the Memory game, tweens. This tween is different from the ones we used in Memory. This one causes the sprite to loop around the kitchen.

(more…)

Playing With Sound and Music

May 17, 2022 Posted by zachary

In Chapters 12 and 13 of Beginning Game Programming, we learned how to add sound and music to games. Thankfully, HaxeFlixel makes doing so easy. The projects for these chapters were to just add sound and music to two existing games, Memory and Dino Cross. So I did that, but I also made a little toy to play with some other sound and music options.

(more…)

Dino Cross Was an Easy Build

May 7, 2022 Posted by zachary

Chapter 11 of Beginning Game Programming is our third complete game of this series. And honestly, it was probably the easiest of the 3 to make. The reason for this was all the work we did up to this point to build out our skills.

I also had a good wind behind me as I made it. Completing Unicorn Dash and the two planets examples really helped motivate me to finish this game.

(more…)

Playing With Planetary Sprites In Two Chapters

May 3, 2022 Posted by zachary

For the latest examples for Beginning Game Programming, we learn about sprites and different sprite behaviors. In these next two examples, we don’t really break a whole lot of new ground, but we do get to play with a few things we have only touched up, as well as play with some existing Flixel Classes.

Both of the planet examples, from Chapters 9 and 10, we start off by generating a field of stars that zooms along in the background. This is a relatively simple implementation as the wonder developers behind HaxeFlixel made it. This class is a drop in solution for any space based game.

(more…)

Chapter 8: Creating a Light Cycles Clone

May 1, 2022 Posted by zachary

After a too long hiatus, I am finally back with the next section of my game development project to convert the game code in a game book to HaxeFlixel. Chapter 8 of Beginning Game Programming gave us a Light Cycles (the game with the motor cycles from the movie Tron) clone. So that is what I did. I decided to give the game a different theme, Unicorns. This was partly to make a game that has a theme my youngest daughter would love.

This project started off great. I was able to create the base game and add two players, both playable via keyboard and game controllers. That was the easy part. Then came the process of drawing lines behind the players. This is where I hit a snag.

In my Crop Circles project, I drew lines between circles and the way I did it then worked for that example. But that code just wasn’t going to work here. I had to find a new method. But this was not as easy as I thought.

(more…)

Let’s Talk About UFOs Anyway

September 24, 2021 Posted by zachary

In my last post, I mentioned that I probably wouldn’t be writing a dedicated blog about the Chapter 7 UFO2 example from Beginning Game Programming. At the time I wrote that, I was thinking to myself that the introduction to Game Controller input would be fairly straight forward and I wouldn’t have much to talk about. But I was wrong.

(more…)

Hey, Its The First Full Game In Beginning Game Programming!

September 22, 2021 Posted by zachary

Before we get into the first full game made in my current project, I wanted to share a few things from Chapter 5. Chapter 5 introduced the developer to player input with the keyboard. In this chapter, we made a little “game” that lets the player fly a flying saucer around a night sky. Fun, but not super interesting. But with what we learned about player input, we can start making real games.

Chapter 6: Memory Game

With the introduction of player input, Chapter 6 gives us an example that uses mouse input. This memory game is a pretty simple concept going back decades or more. You take a deck of cards and lay them face down and try to find all the matches.

I actually created one of these a long time ago when I was still working with Flash and Actionscript, called HexMatch. That SWF is no longer playable and I doubt you would be able to get the code to compile. So I thought it a great time to create a new matching game. Introducing BGP: Memory.

(more…)

Chapter 4’s Slideshow Was No Problem

September 12, 2021 Posted by zachary

Just finished up Chapter 4 of Beginning Game Programming by Michael Morrison. This chapter taught new game developers about bitmaps and how to use them in their games. Since HaxeFlixel handles all those details, I didn’t need to write up a class to read and display them. So I jumped right to the example at the end, A Slideshow.

For this, I used it as an introduction to HaxeFlixel’s sprite animation functionality. The FlxSprite class has some built in animation functionality that you can use to to create a slideshow effect.

(more…)

Beginning Game Programming: Two Chapters Down

September 10, 2021 Posted by zachary

As of today, I have completed the first two code examples from Beginning Game Programming by Michael Morrison. So far, this project has started off fun and even slightly challenging. I am really enjoying it. Here are some of the things I have learned.

Chapter 2: Blizzard Example

This chapter was not too challenging. In the book, this chapter had the reader create a basic game engine in C++. Since we are working with HaxeFlixel, I didn’t need to worry about that. But you do need to know how HaxeFlixel structures its projects. In a barebones HaxeFlixel project you have an assets folder (where all the game’s sprites, sounds etc live), a source folder (where all your source code goes), and a project xml file. The source file starts off with the AssetPaths, Main, and PlayState Haxe files.

The AssetPaths file is a class that scans the assets directory and creates pointer objects that you can use for your games. The Main file Loads in your game and sends the player to the PlayState. The PlayState file is where the core of your game is going to run from. In this file you have the create function, which is where you do all your initialization for your game, and the update function which is where all your game’s core logic will execute from.

In the Blizzard example, I also created a SnowFlake class file which is a basic class file that extends the HaxeFlixel FlxSprite class. The “game” doesn’t have a lot happening other than a timer and counter that controls how many and when to add snowflakes to the game screen.

(more…)

New Game Development Training Program

September 3, 2021 Posted by zachary

Hey Game Development Fans,

My name is Zachary Knight, I am one of the Co-Founders of Divine Knight Gaming. A long while back, we found and fell in love with Flixel, an Actionscript engine for creating 2d sprite based games for Flash. When that engine got ported to the cross platform language Haxe, becoming HaxeFlixel, we couldn’t be more excited about the possibilities. While I have made a lot of progress in learning this engine, there is still much more to learn. That is why I am taking up this new challenge.

(more…)