Wednesday, June 19, 2013

Readers and Writers are Amazing!

Today I built a character file reader as part of my card C#(XNA) card game engine. I learned the importance and usefulness for reader and writer classes. They are my favorite!

Summary:
Each character in my card game has a deck of cards and each deck of cards has a list of cards. To do this, I started by creating a file reader object that read in text from a text file and a text parser which broke up a string into variables wherever it saw the ‘#’ symbol. Then I created three reader classes; one for characters, one for decks, and one for cards. The reader classes used the file reader and text parser to pull in data from a text file and create an object with it. For example: the card reader created a full card object from the data in a text file. After I had a way to create the objects, I made three writers classes, one for characters, one for decks, one for cards, and used them to fill a list of objects.

So, in the end, I have a card writer fill a list of every card in the game, a deck writer fill a list of every deck in the game, and a character writer fill a list of every character in the game.

Why is this method amazing?

This method is amazing because it’s safe and efficient. Every variable is protected and accessible with getters, some with setters. Each object is a utility that can be used on its own (does not rely on the other classes, independent). All your data is in text files and even non-programmers can edit them and change them and create them! Adding content to the game now is as simple as mass-producing text files and some graphics.


Comment about a time when you worked hard to build a tool that made content creation a breeze!

Thursday, June 6, 2013

Flash Is Fast Like Flash

Making some great progress on the Tip The Cows game when I realize why I chose Adobe Flash Professional as my engine of choice.

I'm currently added some achievements and upgrades to the screens and it is going very quickly. All I'm doing is organizing a bunch of buttons on a MovieClip and setting the MovieClip as the source of a ScrollPane. Now you can scroll through all the achievement buttons and click on them! I figured this would be a lot more difficult, but this is why Flash Professional is here. It is made for projects like this. I am so grateful for it because of that.

Perhaps, on a bigger project with a team, we would have our own scroll functionality classes and button-type class to inherit the achievement buttons from, but I just don't have the time for that as a single developer.

I figured these two screens would take a couple days each, but it looks like they will both be finished before today is over! The next part is the hardest, of course; all the achievements owned, data for achievement progress, and upgrades owned must be stored in the database.

Comment any stories where the power of Flash Professional or any other engine greatly surprised you and sped up the development process (the biggest stress reliever on a project).