Space ROX – A Reason to Fight
by Paolo on Feb.11, 2009, under Experiments, Programming

Space ROX V 0.5
Of course, the point of any game is having some adversary to fight – be it enemy ships or floating space debris. Here I’ve taken the particle effect I created for the thrusters and blasters and applied them many-fold on a bunch of asteroids.
The animation for shooting the laser blasters has been modified to have multiple frames for the flash point, and the guns were syncronized.
The next objective is refining the control scheme and creating collisions.
Something of note – it seems that the up-arrow-key, the left-arrow-key in conjunction with the spacebar does not seem to work. Oddly enough, if you use the numeric keypad arrow keys (at least on my keyboard) the limitation goes away. To offset this, I also enabled the A, W, and D keys to do the same function as the arrow keys.
Redoing the control scheme is something that is on the list as well – perhaps using the mouse to shoot which will eliminate this arrow key issue.
Also, an inherent flaw in Actionscript 3.0 is a notable lack of a “Collection” class. Unfortunately the built-in “Array” and “Object” classes does not allow me to recast a stored object back to the original object type. I borrowed Michael James William’s Collection class to handle the multiple asteroids floating around.
February 12th, 2009 on 2:57 am
Hey! Thanks for the link, and I’m glad you found the class useful. I’m a little puzzled by what you mean by ‘the built-in “Array” and “Object” classes does not allow me to recast a stored object back to the original object type’ though. You can do:
for each ( var roid:Asteroid in arrayOfAsteroids )
for example, or
for ( var i:int = arrayOfAsteroids.length – 1; i >= 0; i– )
{
roid = arrayOfAsteroids[i] as Asteroid
}
Anyway, your game feels, looks, and sounds beautiful! Are you going to put it on FlashGameLicense when you’re done?
February 12th, 2009 on 6:58 am
Hi Michael! Thanks for the compliment.
I guess I’ve been spoiled by delegates and lambda expressions in C#. I was also unaware there is an “as” keyword in Actionscript 3.0. I’m still very new to the language.
I would love to put it on FlashGameLicense, however, Jon and I are still working on differentiating the gameplay from a straight-up Asteroids clone. Hopefully we can add a unique gameplay element so we can proudly put the game up for sale.
How about you? Do you have stuff up on FlashGameLicense?
February 12th, 2009 on 10:35 am
Good old C#
Fair enough — always good to see people taking pride in their work!
I don’t have any games for sale on FGL at the moment, but I am working on one. It’s also space-based, coincidentally, though it’s more Space Invaders than Asteroids.
February 12th, 2009 on 10:40 am
With the artist I have working with me, it’s hard not to be! He’s always up for more commission work if you need anything.
Great to meet you Michael. I hope you don’t mind, but I added you to my links page. You’ve got some great stuff on your blog. And it would be great to see more of your stuff when it comes out.
I’ll definitely look into FlashGameLicense once we’ve polished it enough.
February 12th, 2009 on 4:49 pm
I might take you (him) up on that in the future
Nice to meet you too. Thank you for the link, and the kind words. I don’t have a links page on my site, but I have added you to my “Friend Search”: the idea is, anyone searching my site will also get results from a select number of other sites that I think they’ll enjoy. Not sure how useful that is, but it’s worth experimenting.
Are you on Twitter, by the way? I just joined up a week or so ago, and I’m trying to expand my list of gamedev contacts.
Let me know if you would like some feedback when (if) you put it on FGL
February 13th, 2009 on 7:16 am
Currently, I’m not on Twitter. I’ve been debating the usefulness of it, but I’m quickly finding how useful it is on Facebook in terms of social networking.
I’ll let you know once I add myself to Twitter – are there any GameDev feeds you’d recommend?
And I’d love to hear your feedback now – before we say Space ROX is ready to be published. We’re doing Agile development cycles so getting feedback while the game is in process is ideal!
February 13th, 2009 on 1:31 pm
Actually we’re trying to promote a new hashtag, #fgdev, for Flash game dev-related tweets. You can see examples here: http://www.hashtags.org/tag/fgdev
I think it’s a little early to give any in-depth feedback, but like I said it’s coming along great. The one bug I did find was that sometimes I couldn’t get it to accelerate, turn, and fire all at once — but sometimes I could. Weird!
February 13th, 2009 on 2:14 pm
Sounds great! I’ll be sure to start up a Twitter account this weekend and add it to my Blog. Gotta love WordPress.
And about the bug, I found a post on a forum that it is a common problem for some keyboards to not register the spacebar simultaneously with the up and left arrows. So I added A, W, D as an alternative. On my keyboard using the numeric keypad arrow keys works with no bugs, but the non-numeric arrow keys have that bug.
To fix this problem I’m going to switch out the spacebar with the Z key. Z, X and C could all server as “fire” buttons for different types of ammo eventually. I believe those keys with the arrow key do not exhibit this strange behavior in Actionscript.