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…)

Happy New Year! Let’s Talk Goals

January 1, 2022 Posted by zachary

As we close out 2021 and look forward to 2022, I wanted to put some goals for the coming year down. These last few years have been crazy, but there is no reason that we can’t put some control into 2022. I want to put some goals down that will focus on several key aspects of my life: Professional, Personal. and Spiritual.

Professional Goals

For professional goals, I think it is pretty easy. I started up a project to convert the code examples in some programming books I have to HaxeFlixel. The purpose of that is to help me more familiarize myself with the game engine, and to provide some example code that people can use in their own projects. I started off strong and managed to finish 6 chapters before taking a long break. For my first goal, I will finish this project this year. (hopefully it won’t take that long).

My second goal in my professional life is to finish and release a full game this year. As I work on the above goal, I will be making more games that are like toys and less like massive games. I have a tendency to overthink and over plan game projects and get burned out. So instead, I want to create one game that is more about a narrow game loop with a lot of replayability. This doesn’t mean I won’t put time into larger projects, but my main focus will be on completing one fun replayable game.

Personal Goals

For my personal goals, I am focusing on what will improve my self. I am currently overweight by a lot. I get worn out pretty quickly. I am just not too healthy. So my first goal here is to start exercising. I am not planning on joining any gyms or subscribing to any weight loss program. Instead, I just want to take it simple with what I can do at home. I want to take daily walks with my wife. When I have time, I will do some simple exercises using my pull-up bar and some free weights I have. Just enough to get me into a mindset of taking care of myself.

But it isn’t going to be all exercise. I also want to have some fun. I have a number of books I want to read and will be doing that. I also want to play several games from my back catalog that have been staring at me for a while. No pressure here, just pick a book and read it. Pick a game and play it. I am not saying I will read or play X number of things. Just do more of it.

Spiritual Goals

For spiritual goals, this is pretty simple. I will read my scriptures daily and pray daily. I have been lacking in this aspect of my life for a while and need to make it a habit. Even just a little reading or saying some quick prayers will help. So that is what I am focusing on. My wife has bought some study aids that I hope will help and she would be happy to see me use them.

So there you have it. My goals for the coming year. I don’t to pressure myself, so I won’t be making regular evaluations etc. But I might revisit this later and provide an update. The only real updates that will happen regularly will be about the programming projects I work on.

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…)