Sunday, August 30, 2009
Flex lightweight dialogs?
I miss the JOptionPane classes that you have in Java. I'm working on my Adobe AIR game level editor and I wanted to pop up a quick and dirty dialog that prompts for the name of the new level. Flex's Alert dialog just returns a binary value: yes|no, OK|cancel. In Java, with a line of code you can prompt the user for a text input value and keep right on going. In Flex, you have to take a TitleWindow mxml component and customize it and wire up events to get the data back etc. Just feels like a lot of boilerplate.
Monday, August 24, 2009
Flex Builder debugger hangs
Keep running into this issue where the Flex Builder debugger hangs when I launch my application. Digging around on the net, the bug seems to show up randomly, but is very frustrating. I did find the bug mentioned in the Adobe Bug list and they claim to have fixed it internally, but they haven't shipped a fixed Flash Player that addresses the problem. The current workaround is to set the affinity of your javaw.exe process (that is launched when you start Flex Builder) to only 1 CPU using the Task Manager Processes tab and right-clicking on the javaw.exe process. I have a quad core system and this bug bites me all the time. The workaround appears to address the issue.
Tuesday, August 18, 2009
Progress
I plan on using this blog to chronicle the development progress of my game. I decided to prototype the game concept using Flash, and once refined, to port the game to the very popular (and potentially lucrative) iPhone. I know that the inital gold rush for the iPhone is over, but I'd like to put iPhone development experience on my resume and I think the experience will be fun.
It may seem that I'm writing the game twice, once for Flash and then again for the iPhone, but Flash has grown up with the advent of ActionScript 3. This allows you to create classes and object hierarchies very similar to Java, which are easy to map to C++. The iPhone lets you code in C, C++, and/or Objective-C so the core of the game should port pretty easily. Flash was designed to quickly let you throw something involving graphics and interactive elements very quickly, and in experienced hands lets you focus on the problem as opposed to implementation.
I'm not ready to post screenshots of the game itself, but I'm at the point where I need to develop a level editor to have a tool that I can use to tweak and quickly modify game data. I decided to use Adobe AIR, since I already know Flash and Flex (from work), and Adobe AIR basically adds APIs to access OS resources such as files. I'll be talking about this effort in future posts.
It may seem that I'm writing the game twice, once for Flash and then again for the iPhone, but Flash has grown up with the advent of ActionScript 3. This allows you to create classes and object hierarchies very similar to Java, which are easy to map to C++. The iPhone lets you code in C, C++, and/or Objective-C so the core of the game should port pretty easily. Flash was designed to quickly let you throw something involving graphics and interactive elements very quickly, and in experienced hands lets you focus on the problem as opposed to implementation.
I'm not ready to post screenshots of the game itself, but I'm at the point where I need to develop a level editor to have a tool that I can use to tweak and quickly modify game data. I decided to use Adobe AIR, since I already know Flash and Flex (from work), and Adobe AIR basically adds APIs to access OS resources such as files. I'll be talking about this effort in future posts.
Cosine Interpolation
Picked up this handy little function while reading "Programming an RTS Game with Direct3D". It's an alternative to linear interpolation that interpolates a cosine wave between 2 points:
float CosineInterpolate(float v1, float v2, float a) {
float angle = a * PI;
float prc = (1.0f - cos(angle)) * 0.5f;
return v1 * (1.0f - prc) + v2*prc;
}
This results in a smoother interpolation between the two points.
float CosineInterpolate(float v1, float v2, float a) {
float angle = a * PI;
float prc = (1.0f - cos(angle)) * 0.5f;
return v1 * (1.0f - prc) + v2*prc;
}
This results in a smoother interpolation between the two points.
Subscribe to:
Posts (Atom)