I would normally base mine on number of hours spent.
When I worked for a company that wrote web sites/games etc, my time was charged around £90.00 per hour.
However, if you are "doing it for a friend" I would probably cut that to around £15-£30 per hour, or free depending on the friend/circumstances.
Normally, for a client from home, it would be around £30-£60 per hour depending on how experienced I am at the particular skills required (to account for learning time).
You would then need to work out how much time on each part will take (design/coding/testing etc...) and add it it up, then multiply by the price per hour you have decided to charge.
Just as an example, this game that I wrote in my current job:
took about 100 hours(about 2 - 3 weeks (about 50% testing)) of my time and another 20 hours of a designers time.