Amidst work and life, I have managed to get quite a bit further in the development of my Halloween stack game. My wife and I have drawn almost all of the Halloween-related characters and I am starting to experiment with how the user will interact with the stack of the characters.
I think tweaking the mouse grab and the way the characters lay on each other will be the biggest challenge coming up. Below is the latest screenshot of the game:
I should have all of the characters done this week and I will let you know how I solve the mouse grab issues. See ya soon!
Monday, September 20, 2010
Friday, September 10, 2010
Halloween Game in the Making!
In the upcoming spirit of Halloween, I have decided to make a little casual Flash game that involves a pile of characters stacked together in the center of the screen. The goal of the game is to get all of the characters from the pile into a box that you drop them into.
Think of a Jenga-type game, except that the blocks are actual little faces of Halloween characters. A little indicator box will appear in the top left part of the screen that tells you which character you need to pick out of the pile and put into a box.
Since the pile is made up of several different characters, the one you need to pick may be buried in the middle of the pile, or even on the edge. Do you re-stack some of the characters to try and reach the one you want, or do you risk the whole pile falling over by trying to drag the character out? If the pile falls over, you lose the game. I think there will be a point system or a timer that can keep the tension up. I might try and include achievements for not letting any characters fall to the ground, or something along those lines.
I am using the QuickBox2D library for my physics engine, and a little routine that makes the mouse cursor turn into a hand that can grab and drag the characters. My wife has been helping with the character design and scene concepts, and I think it is coming along real well so far. Any time you can involve your wife in making a game, life sure does start to feel good :)
Below is a very, very early version of a creepy Halloween level that I am making:
The pile is not constructed yet, but I have put a few test objects in there to see how it would look once I get more characters drawn. I will keep posting as I get further along!
If there are any of you out there reading this, let me know what you think so far. I would appreciate any feedback.
Thursday, August 26, 2010
The Stupidity of IT
This is an off-topic post about something that I witnessed not too long ago at my job.
I happened to be walking by one of our conference rooms and noticed something really peculiar. There were about 20 overdressed guys in suits, all sitting around two tables that they had joined together. The projector was displaying something on the screen, yet all of the conference room lights were on (insert "here's your sign"). Everyone was shaking their heads in what seemed like a synchronized bow of approval, gawking at what was on the screen in front of them.
Given this mass reaction, I half expected to see something that would be mind-blowing, or a cure for some disease...I even would've been OK to see some new software that a company was soullessly trying to sell to us for thousands of dollars. But, alas, I saw one of the dumbest things I have ever seen in my entire life - please look below:
No, I didn't leave out any additional text that might make this grid make any more sense. It was really this stupid. I don't know what they could've been talking about, but this, regardless of the conversation, is just plain asinine.
Do you ever question your job?
I did that day, and I have been laughing (and crying) about this ever since.
Wednesday, August 11, 2010
Level Loader Tutorial in AS3 using Function Pointers
In a game you often come across the need to change levels. In my case, while making a mini-golf game, I obviously have the need to go from hole to hole as the player makes their shots. Since I load my level content through a method call, such as loadLevelOne(), I needed a way to be able to make those calls without explicitly knowing what order to call them during runtime.
AS3 has a very easy way to do this that I think is worthy of a quick tutorial. Since a function that you declare in a class is of type function, you can pass them around like objects or, as in my case, store them in an array that you can cycle through. You only need a couple of variables and a few utility methods to do this.
Let's say you have two levels to load for your game and you have defined them somewhere in your code, as follows:
private function loadLevelOne():void
{
...
}
private function loadLevelTwo():void
{
...
}
As members of your class, you can make the following variables:
// Levels array that stores Functions
private var _levels:Array;
// A variable to keep track of where you are in the array
private var _levelIndex:int;
In the constructor of your class, or in a separate method, make sure to initialize your variables, and then "load" the functions in to the array:
// Initialize the levels array
_levels = [];
// Set the level index
_levelIndex = 0;
// Load the method calls into the array
_levels.push(loadLevelOne);
_levels.push(loadLevelTwo);
You could also do this more explicitly if you wanted by creating a variable of type Function, setting it to the name of the function, and pushing that into the array, like this:
// Function pointer variable
var functionPointer:Function;
// Load levels
functionPointer = loadLevelOne;
_levels.push(functionPointer);
If you didn't know the exact order you wanted to load your levels, or if your situation for loading levels occurred in a more dynamic nature than in my mini-golf game, then the preceding example may be a better fit for you. In order to get through the levels and actually call them, I created the following utility methods:
// Runs the current level
private function runLevel():void
{
// Check to make sure that your levels array has data
if (_levels.length > 0)
{
// Get the function pointer out of the array
var currentLevel:Function = _levels[_levelCounter];
// Call the method
currentLevel.call();
}
}
// Switches to the next level
private function switchLevel():void
{
// Check that you are still in bounds if you switch levels
if (++_levelCounter < _levels.length)
{
// Get the function pointer
var currentLevel:Function = _levels[_levelCounter];
// Call the method
currentLevel.call();
}
}
// Retry the current level
private function retryLevel():void
{
// Get the current level
var currentLevel:Function = _levels[_levelCounter];
// Recall the method
currentLevel.call();
}
So, hopefully this is of some use to you out there if you ever needed to use a structure like this. There are a lot of other uses for this as well, for instance, if you had an RPG like Diablo 2 or World of Warcraft. In those games, your character often has spells (good or bad) that affect the player over time. You could set this up as an array of function pointers that get cycled through per frame, with each function handling the different spells that are cast on you. Of course, that may be a horrible way of handling it, but at the very least, it is some food for thought.
See you next time!
AS3 has a very easy way to do this that I think is worthy of a quick tutorial. Since a function that you declare in a class is of type function, you can pass them around like objects or, as in my case, store them in an array that you can cycle through. You only need a couple of variables and a few utility methods to do this.
Let's say you have two levels to load for your game and you have defined them somewhere in your code, as follows:
private function loadLevelOne():void
{
...
}
private function loadLevelTwo():void
{
...
}
As members of your class, you can make the following variables:
// Levels array that stores Functions
private var _levels:Array;
// A variable to keep track of where you are in the array
private var _levelIndex:int;
In the constructor of your class, or in a separate method, make sure to initialize your variables, and then "load" the functions in to the array:
// Initialize the levels array
_levels = [];
// Set the level index
_levelIndex = 0;
// Load the method calls into the array
_levels.push(loadLevelOne);
_levels.push(loadLevelTwo);
You could also do this more explicitly if you wanted by creating a variable of type Function, setting it to the name of the function, and pushing that into the array, like this:
// Function pointer variable
var functionPointer:Function;
// Load levels
functionPointer = loadLevelOne;
_levels.push(functionPointer);
If you didn't know the exact order you wanted to load your levels, or if your situation for loading levels occurred in a more dynamic nature than in my mini-golf game, then the preceding example may be a better fit for you. In order to get through the levels and actually call them, I created the following utility methods:
// Runs the current level
private function runLevel():void
{
// Check to make sure that your levels array has data
if (_levels.length > 0)
{
// Get the function pointer out of the array
var currentLevel:Function = _levels[_levelCounter];
// Call the method
currentLevel.call();
}
}
// Switches to the next level
private function switchLevel():void
{
// Check that you are still in bounds if you switch levels
if (++_levelCounter < _levels.length)
{
// Get the function pointer
var currentLevel:Function = _levels[_levelCounter];
// Call the method
currentLevel.call();
}
}
// Retry the current level
private function retryLevel():void
{
// Get the current level
var currentLevel:Function = _levels[_levelCounter];
// Recall the method
currentLevel.call();
}
So, hopefully this is of some use to you out there if you ever needed to use a structure like this. There are a lot of other uses for this as well, for instance, if you had an RPG like Diablo 2 or World of Warcraft. In those games, your character often has spells (good or bad) that affect the player over time. You could set this up as an array of function pointers that get cycled through per frame, with each function handling the different spells that are cast on you. Of course, that may be a horrible way of handling it, but at the very least, it is some food for thought.
See you next time!
Tuesday, July 20, 2010
Todd Kerpelman's Box2D tutorials and FlashDevelop
I've been getting into Erin Catto's Box2D physics engine recently (www.box2d.org) and I have found some great tutorials for the Flash version from Todd Kerpelman. He has put together 22 really awesome videos on the basics of how Box2D works and how to integrate the engine into your games. Even cooler is the additional 50 videos he has to create your own version of a PopCap game Peggle Nights (cleverly titled Puggle) using Box2D. I am in the process of going through these myself and I amazed at the quality and the amount of time he put into them. Please go check them out at: http://www.kerp.net/box2d/
Another thing that Todd mentions is the use of FlashDevelop in tandem with the Flash IDE. I think FlashDevelop is awesome because it provides a lot of shortcuts to increase your coding time and has a form of Intellisense when you are coding. Anyone who has coded within Flash would appreciate this because the Flash IDE leaves a lot to be desired for developer who is used to Microsoft's Visual Studio or something like that. If you watch the videos, you can see how Todd uses both environments. You can get FlashDevelop from the following link:
http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page
My recommendation would be to let the installer follow its basic installation routine - I had no problems with this and have been using for a while now.
Anyways, I just wanted to give some props to Todd Kerpelman for providing a great developer resource. We need more people like him out there.
Another thing that Todd mentions is the use of FlashDevelop in tandem with the Flash IDE. I think FlashDevelop is awesome because it provides a lot of shortcuts to increase your coding time and has a form of Intellisense when you are coding. Anyone who has coded within Flash would appreciate this because the Flash IDE leaves a lot to be desired for developer who is used to Microsoft's Visual Studio or something like that. If you watch the videos, you can see how Todd uses both environments. You can get FlashDevelop from the following link:
http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page
My recommendation would be to let the installer follow its basic installation routine - I had no problems with this and have been using for a while now.
Anyways, I just wanted to give some props to Todd Kerpelman for providing a great developer resource. We need more people like him out there.
Sunday, July 18, 2010
A Start
Hello! This blog is just a fun way for me to express to you my interests in game programming - with a little bit of humor and other ramblings thrown in. I am going to post some tutorials and code that you can use, as well as, link to people's websites that are way better at it than I am.
I believe that a great way to learn game programming is through example, and it is how I have learned what I know so far. That being said, I will attempt to do all of my tutorials that way. I am by no means an expert, and I don't claim to know the best way to do these things. But, at the very least, I hope to give some inspiration to those out there who have a passion for creating games.
Please leave comments and feedback.
Enjoy!
Subscribe to:
Posts (Atom)


