Friday 17 February 2012

Why circles (and spheres)?

One interesting question is: "Why are circles (and by extension spheres) better for games?". I don't just mean computer games but a wide variety of games and sports use balls: marbles, billards, tennis, pétanque and football. Still more use circles: curling, shuffleboard and air-hockey.

Thursday 16 February 2012

On framerate

In recent discussions I've been involved in I've noticed that developers have a lot of ideas about the best frame rate for a game. Unfortunately many of those ideas are wrong, often for very straightforward reasons. As I've been thinking about this again for the game I've started I thought it worth a post on this.


The main point is there are only two frame rates you should consider: 30fps and 60fps. And 90% or 95% of the time you should choose 30fps. Why?

Wednesday 15 February 2012

Flex

I got Flex working yesterday. It was something I tried with Bug Tunnel Defense but never got working; the best I managed was it building without errors but without finishing. I.e. once I'd fixed all the compiler errors the compiler would take forever. This was impossible to diagnose, I could not share the project with anyone else to see if they had any insights, so I had to give up.


This time I tried it with a relatively small and new project, that consists of only ten mostly small source files and one graphic asset. I eventually got it working, but it took much more time than it should have.

Tuesday 14 February 2012

Quadratic curve through three points

Flash has a couple of curve drawing functions in the Graphics class, curveTo and cubicCurveTo, but they can be difficult to use as they use control points. Control points are points off the curve which the curve tends towards. They are intuitive to use when editing in a graphics app but less useful in code when a curve through a point is needed.

Monday 13 February 2012

drawCircle is slow

This is something I discovered at the weekend. I already knew that the drawCircle function of the Graphics class is slow, slow enough that you don't want to be using it to draw too many circles at once at runtime. Instead render them into a BitmapData using BitmapData.draw wherever possible.