kxmode wrote on Aug 12, 2010, 22:04:
I've never seen C++ code before, but I'm trying to figure out if there is more to it than what I saw. Can anyone tell me what the differences are? Is ActionScript 2 like C++?
It's quite similar in several respects - the methods of creating functions, performing basic operations, and nesting {} are quite similar. You should have no problem tinkering with the existing code, changing a few numbers, etc.
I'm not familiar with AS2, but I think you'll notice three major differences:
1) The available libraries (import xx in your AS code) in most C/C++ applications are very limited. Even though it's built on OpenGL, I expect you'll find that id have had to write their own wrapper functions for drawing graphics, and so on.
2) Creating a new object in C involves declaring it (like any scripting language), and in many cases allocating memory for it as well, then de-allocating the memory once you're done with your work. You don't have to bother with that stuff when working with scripting languages (or .NET), which is one reason they're so popular.
3) Scripting languages are very self-aware - they'll let you know if you go out of bounds on an array, or try and use a variable that hasn't been given a value yet. C just fails. It can be a real pain to debug.