Late to the Flash gamedev party

Development, Games, Web

I never touched Flash coding before this weeked - I’ve never really felt inclined to do so, I generally dislike Flash interfaces on websites and as such I never felt the need to buy expensive tools from MacromediaAdobe to develop in that environment. There was also the fact that forcing someone to install a plugin to view your content always left a bad taste in my mouth.

A few things have changed that attitude recently though. Firstly, the ascension of video on the web from the likes of YouTube has meant that everyone now has  a Flash player installed, far more than previously, which has mitigated the plugin concerns. Secondly, Niko brought to my attention that Adobe’s Flex SDK from Adobe is now open source, meaning that anyone can develop using their base tools now for no money down. Adobe do in fact seem to be embracing open source quite a lot these days, which I obviously applaud. Lastly, there’s one area beyond video playing where Flash does in fact justify itself among other web technologies, and and that’s game development. A lot of Flash games I’ve seen are pretty awful, but having discovered N+ on my 360 recently I was really impressed with the original N which was released as Flash. I have a bit of a penchant for stylish 2D gaming so that inspired me to give it a try myself this weekend.

I’ve been impressed. I’d heard all sorts of horror stories about ActionScript in the past, but I find AS3 really quite pleasant to use - it’s fast, pretty object-oriented now and I was comfortable using it in about an hour. The Flash environment in general is pretty friendly, and I managed to go from absolutely zero knowledge of Flash before the weekend, to developing my first (admittedly pretty crappy) game in only a handful of hours. So here it is :)

It’s a simple Lunar Lander clone where the idea is to land on the coloured platforms. You get more points for smaller platforms (the green one is a total bitch), and to score you have to put both ‘feet’ of your ship down on the surface and stop moving. You will die if you touch down too hard, and also if any part of your ship apart from the bottom of the feet touches the scenery.Click on the game to start, the controls are:

Left/Right arrow = turn   SPACE = thrust   R = restart


I know it’s not that impressive, but I was quite pleased to get this going in basically an afternoon and an evening with no prior experience. I used FlashDevelop as an IDE, which was surprisingly good - the only problems with it are no debugging support (which makes it quite hard to know what’s going wrong if you’re new) and that it only runs on Windows. I’ve now downloaded, but not tried yet, the absolutely enormous trial version of the Flex Builder 3 which is the ‘official’ dev tool, and has the advantage of being Eclipse based (awesome, multi-platform) and supporting debugging, so I’ll see what that’s like in comparison later. I also used a couple of libraries: Flint to do the smoke particle effect on death (which is great except that you don’t seem to be able to pause & restart just emissions rather than the entire system), and Box2DFlashAS3, a great 2D physics engine which is basically an AS3 port of the C++ Box2D.

On the whole then, I enjoyed myself with this stuff yesterday, it’s nice to be working in an environment that’s easy to use and you can get deployed in no time at all. I did a quick look around and didn’t find any ‘complete’ game engines for Flash, unusually, so I built my own simple one here - I did initially think about doing something clever with abstract property and event systems, but decided just to bash something specific out this time. Maybe I’ll write a more complete engine for it sometime :)

Edited 4 March: since some people have asked, here’s the source code, released under the Do What The Hell You Like With It Public License :) It’s quite shabby, so don’t laugh.

Share this post: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • N4G
  • StumbleUpon
  • del.icio.us
  • Mixx
  • Google
  • blogmarks
  • Slashdot
  • Reddit

29 Responses to “Late to the Flash gamedev party”

  1. GameDevMike : Steve Streeting on Flex Says:
    March 2nd, 2008 at 2:12 pm

    [...] Steve Streeting took a dive into Adobe Flex and wrote up his opinions of the experience. I wasted entirely too much time playing that little lander game he threw together in an afternoon. I’ve been considering toying around with Flex as well, if I can make the time for it. [...]

  2. NicRobertson Says:
    March 2nd, 2008 at 4:02 pm

    Wow this is strangely addictive - maybe I’m just retarded but it’s hard!

  3. Henry Says:
    March 2nd, 2008 at 4:05 pm

    I also think Flash is awesome, and seriously underestimated by certain parts of the development community. For instance, I’m pretty sure there’s a clan of anti-Flash redditors that mod down Flash for no reason. Anyway, they are the ones losing out, cos it’s a great environment for coding, and you should definitly try out Flex Builder - increases productivity no end.

  4. Yaraher Says:
    March 2nd, 2008 at 4:08 pm

    I must say I completely agree with your point of view. I start using Flash on one of their first iterations (before any proper AS standard) but then move on to other things.

    I have planned to return to the Flash/Flex world this year, mainly motivated by how AS has turned out. I’m really impress of the changes they’ve made on each version, a radical approach maybe, and with lots of risks to lose those ranks of designers who were used to some basic AS 1 interaction (which is by no means wrong at all).

    I’m a bit curious of what’s the best way to develop at it. I’ve heard FlashDevelop is one of the best IDEs currently, but saddly I decided last year to move to a Mac/Linux platform, which leaves me without it (although, I haven’t really tried emulating it). The Flex Builder seems really nice (still haven’t tried it deep) but I think is more.. Flex oriented (hence the name :P) and not quite sure how it works as a more generic AS development environment.

    Maybe some Ogre-AS magic coming on a (far) future? :P

  5. paul Says:
    March 2nd, 2008 at 4:57 pm

    Hehe thats pretty good man, in fact for your first attempt, and all in one day, I’d say thats fantatic.
    Ive done work in ActionScript before (basic ‘webby’ stuff) but not attempted any game coding.

  6. M Says:
    March 2nd, 2008 at 11:23 pm

    > Maybe some Ogre-AS magic coming on a (far) future?

    Check out Papervision3D

  7. Falagard Says:
    March 3rd, 2008 at 4:26 am

    I finally landed on all platforms. I was hoping for some sort of “Congratulations, you beat the game!” messages but nope!

    Fun game though, Steve!

  8. niko Says:
    March 3rd, 2008 at 5:41 am

    Hehe, very nice! Going to present my little flex game on my blog this week as well :)

  9. Paul Evans Says:
    March 3rd, 2008 at 9:57 am

    what, no source? ;-)

  10. Steve Says:
    March 3rd, 2008 at 11:58 am

    Thanks for the positive comments :)

    @Falagard: yeah, I probably should have put something in there for getting all the platforms, but I ran out of time. I wanted to make the ship explode more interestingly and do a scrolling playfield too. Maybe in v2 ;)

    @Paul: I didn’t think the source would be that useful to people since it’s mostly hacked together ‘learning’ code. If anyone really wants to see it I’ll happily post it.

  11. Dan Says:
    March 3rd, 2008 at 2:36 pm

    @Steve: Too funny, when I heard about XNA coming to the Zune I thought it might be fun to write a simple ZuLander game based on Lunar Lander. Glad to see Lunar Lander is still a fav amongst us 30 somethings. :)

  12. Steve Says:
    March 3rd, 2008 at 2:40 pm

    Hehe, the name ‘ZuLander’ is inspired :)

  13. Happy-Howard Says:
    March 3rd, 2008 at 4:20 pm

    Nice game! Reminds me of Gravity Force on the Amiga. One of my favorite games back in the day!

  14. warmi Says:
    March 3rd, 2008 at 4:37 pm

    Hmmm… I am 30 something and I don’t even remember this game.

    My favourites were things like Knight Lore, Boulder Dash and Bomb Jack :-)

  15. Dan Says:
    March 3rd, 2008 at 4:59 pm

    @warmi: wow, really? For me, Lunar Lander was right up there with Asteroids, but maybe I just liked LL a little too much. :)

    BTW, XNA on Zune video here: http://www.on10.net/blogs/laura/GDC-XNA/
    Yeah, Laura can get annoying and she looks like she’s been dipped in a barrel of hairspray. :)

  16. Kojack Says:
    March 3rd, 2008 at 7:44 pm

    Hehe, Box2DFlashAS3 was made by one of my former students. :)

  17. Kentamanos Says:
    March 3rd, 2008 at 8:37 pm

    Very neat Steve. Now add turrets, missles, etc. and remake Oids! :)

  18. irrdev Says:
    March 4th, 2008 at 8:58 am

    Nice game! I really wish Adobe would come out with a Linux version of the Flex SDK/FlexBuilder. It is actually rather surprising that this OS isn’t remotely supported, as many web developers use Linux as their main development platform. In the meantime, I’ll have to stick to Java applets…

  19. Steve Says:
    March 4th, 2008 at 9:03 am

    @Kojack: Hehe - small world :) It’s a great port for sure.

    @Kentamanos: Oids was exactly what I was originally thinking of when I started in fact :) I just scaled back to a simple Lunar Lander clone for my first game just so I could ‘finish’ something quickly.

    @irrdev: well, the SDK is open source so I don’t see why it can’t be built on Linux.

  20. John Burton Says:
    March 4th, 2008 at 11:08 am

    Very nice :)
    One small problem is the the web page every time I come here gives me a banner at the top asking me to install flash player which I already have of course. This is on IE7 on vista.

    I recently discovered flex too. I tried flash a year or so ago because I wanted to produce a couple of little “applets” for a website I had. I originally made some java applets but found that although java is in many ways better it was pretty unusable for small applets on web pages.

    However I just couldn’t get on with flash. I found the official development environment and the whole timeline thing fairly incomprehensible. The whole thing just seemed a horrible mess, and I gave up. But when flex came out I looked again and frankly I love flex - Actionscript may be based on javascript, but it feels like a real language here and in many ways I now prefer it to java. Things like proper properties, and the event handling system just seem to much better thought out than the “hacks” for both that java uses.

    I bought flex builder 3 online after trying the demo. Although I got a long way with the free SDK flexbuilder seems a really nice tool and the price is quite low now for a decent development tool.

    it also lets you develop “air” applications. I initially had no interest in those but after having a play feel the need to make something with it!

    I really think adobe have intented something good here from the mess that was flash (in my opinion :) )

  21. Steve Says:
    March 4th, 2008 at 11:28 am

    @John: ah yes, I get that in IE7 too (XP). I never use IE to be honest so hadn’t noticed. I notice Box2DFlashAS3’s does it too on IE7, maybe there’s a problem with the embed tag or something (I copied theirs).

  22. mr. iknoweverything Says:
    March 4th, 2008 at 4:03 pm

    hmm, im kind of curious, how are you determining the damage in your little demo app? stupid question i guess, but it seems very simple and elegant :)

  23. Steve Says:
    March 4th, 2008 at 4:56 pm

    It’s actually very simple - I check the intensity of the collision as reported by Box2D, it’s the ‘normalImpulse’ on the contact point. If it exceeds a certain threshold, I consider it ‘too hard’ and trigger the Ship.die() sequence :)

    I’ll upload the source and edit the post in case anyone wants to see my crappy code.

  24. mr. iknoweverything Says:
    March 5th, 2008 at 1:57 am

    duh, super simple. everything felt so natural and “realistic” in the game i just thought you did some black “so straightforward its not obvious anymore” magic.

    there we go, the simple solutions yield the best results :)

  25. mr. iknoweverything Says:
    March 5th, 2008 at 2:12 am

    but, yes, please upload your code. i suck monkey balls, so if your code sucks you dont have to be ashamed, it surely wont be me to figure out ;)

  26. Simon Says:
    March 5th, 2008 at 1:12 pm

    Hmm guys

    how do you restart the game after you crash is it a case of just reloading the page?

    and yep its hard

  27. Steve Says:
    March 5th, 2008 at 2:12 pm

    See the bold text above the game that talks about controls? “R = restart”.

  28. Steve Says:
    March 6th, 2008 at 10:37 am

    @mr.iknoweverything: Code is already uploaded, see the bottom of the original post

  29. tau Says:
    March 9th, 2008 at 10:12 pm

    awesome job, Steve! I’m really impressed with this one - u got it right with zero Flash experience!

Leave a Reply