Game Devigner

Tag: space rox

Being a Game Developer Dad

by Paolo on Feb.04, 2009, under Meanderings

It’s a neat experience being an indie game developer and a dad. Unlike my daytime job, there is very few impressive visuals in ASP.NET web applications that I could use to impress my son. There is only so much map searching and results grids can do for a 3 year old. But making a space ship that shoots asteroids? Now that’s something he knows!

It’s been a pretty rough week so my development has been slow going for Space ROX the last few days and I’ve lost momentum. But having a 3 year old begging me to make the spaceship shoot its cannons has been more than a motivator for me to get right back on track and moving. Seeing the delight on his face when the spaceship could finally shoot its guns was well worth the lost sleep.

Now that he can shoot the ships guns, he wants something to shoot. I can’t wait to see his face when I get that part done. It’s really exciting being a game developer dad. You have the most enthusiastic QA team ever.

Leave a Comment :, more...

Space ROX – Under Fire

by Paolo on Feb.03, 2009, under Experiments, Programming

Space ROX V 0.3

Space ROX V 0.3

Now, using a mix of local and global coordinate magic, we can put a laser blast on the correct firing points of the Space ROX ship – one on the left and one on the right using alternating fire. Rather than using some complex math to figure out the scale and rotation of the ship MovieClip, I can derive where I need to put the laser blast picture.

Check it out!

Leave a Comment :, , , more...

Space ROX – Local, Screen, and World

by Paolo on Feb.03, 2009, under Experiments, Programming

When it comes to displaying graphics, the most common question a program must ask is “Where is it?” It may seem like a straightforward question, but it has a lot of complex nuances. Take for instance the image below of the ship in Space ROX.

Space ROX's Local Coordinates

Space ROX's Local Coordinates

Now, the rotation point of the entire graphic is at the center of the ship. Right below the ship is the rear thrusters firing. When the ship is accelerating and I need to draw a particle effect, I need to find out where the tip of the rear thrusters are as the origin of the particle. When I ask ActionScript 3.0, what is the x,y coordinate of the RearThruster, it simply says it is at 0,190. But this is local coordinates – it doesn’t matter which way the ship is rotated or how much it has been scaled.

Space ROX Rotated and Scaled

Space ROX Rotated and Scaled

What Actionscript 3.0 offers is a function called “localToGlobal” which can tell me where a local point in this movie clip is in relation to the screen’s coordinates.

This is great, but it has one major flaw in terms of game programming.  The “localToGlobal” function only tells you the coordinate of the object in relation to the screen – not in relation to the world.  If the camera and background never move like in the first versions of Asteroids, then this is sufficient information that we need.  But once the camera starts moving around a world, then we need to convert Actionscript’s “global” coordinates to the “gameworld” coordinate plane to ensure that if the camera moves, the particles and effects, correctly shift along with the camera.

What is so painful about this is that my original approach to solving the local-to-screen-to-world coordinate system is that I was trying to figure it out using what little I remember of Trigonometry.  It was a relief to see that Adobe went through the trouble of creating a build-in and optimized version of what I was attempting to write.

Leave a Comment :, , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll