[Brought over from last blog]
I thought it was about time to post my adventures with AS3. As most of you know (if you follow my blog), I’ve recently started to mess around with AS3 using Flash Develop.
I first started over a month ago, but had to stop for almost 3 weeks while I was away on a trip.
However, throughout the last week I’ve picked it up again, and started making my little flash shooter, found here.
AS3 is a really interesting language. It first reminded me of C#, as the syntax scheme is similar, and the way things are run are also similar.
I don’t know all that much C#, so I couldn’t go into very much depth as to what is similar, but the basic layout of the code didn’t seem all that different.
Anyways, it really didn’t take me very long to pick up the basics of AS3. I had a running platformer with pixel perfect collisions within the first 4 days. I think this is due to the fact that I’ve been programming in Game Maker for over 3 years, and messing around with other languages such as C#, VB.NET and PHP. However, if AS3 was my first language, I can tell you right now I probably would have stopped dead in my tracks and quit programming the first day. Not to say AS3 is extremely hard. From a programmers perspective it’s relatively easy. But, in comparison to Game Maker, it’s a lot more difficult to work with.
Some things that bothered me right away was the fact that when a child of an object is destroyed, some of its events aren’t destroyed with it. If you think about it in terms of Game Maker, say you have an object that then destroy’s another object. When that instance is destroyed, its step event doesn’t necessarily stop. So, in the case of my shooter game, it caused very weird bugs when the game was restarted, enemies were killed, etc. The only way to fix this problem is to make sure you destroy the “ENTER_FRAME” event (along with all the other possible interfering events).
Game Maker has rooms, where you can place objects of certain types. When you’re done with that room, you can simply switch to a new one, without a single problem.
AS3, however, does not have rooms. It basically just has one stage, and you have to create and remove objects appropriately to build each part of the game (be it a menu, a level, or a highscore table). I’ve come to build objects for each part of the game I want. One sets everything up, another acts as the menu, another as the main game control. The Menu then adds more objects when it’s created (such as the title, or the menu buttons). Once it is removed, all of its child objects are removed with it… a bit more complicated than Game Maker!
So, it takes some time to get used to it, switching from Game Maker to AS3. (Not to say I’m stopping development with GM – I’m certainly not! I really like it). They both have their ups and downs, but Game Maker is definitely easier to use.
hmm.. thats all I have to say about AS3 at the moment.