Decided to spend a few hours a week learning a new language: Clojure. This up and coming language for the JVM provides LISP style functional programming and with pragmatic access to the huge body of Java libraries and APIs. It just recently turned the corner and went 1.0, and there appears to be enough community support so that it doesn't feel like you are by yourself. Picked up Programming Clojure as my book guide.
Programming Environment: Netbeans IDE 6.7.1, Enclojure Plugin, jVI for text editting. Most LISPers use Emacs, but I'm more of a VI guy, don't want to learn a brand new editor on top of a language. Netbeans seems to have good Clojure support, integrated debugging and a decent VI plugin so that I can cruise through code easily.
NOTE: The jVI plugin doesn't play well with the REPL window, I had to disable it when typing code inside it. Nuisance, but not a showstopper.
Friday, October 2, 2009
Tuesday, September 29, 2009
Reflection in ActionScript
After a little digging it turns out that Flash has a nice reflection function to discover information about a type. The function, called describeType(), returns an XML object populated with data such as the full qualified name of the class, all its methods, what class it extends from etc. Why is this useful? Well, it gives you the chance to find out at runtime what kind of object you have. I wonder if you can use something like this to implement a version of Reflector (a .NET tool that lets you view code from assemblies) for ActionScript?
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)