I’ve always wanted to write a game. For the longest time, every time I’ve looked into it, I’ve been overwhelmed by the number of options in what language or framework to choose, what type of game to write and what kind of story I want in my game. This desire to write a game usually lasted for a couple days of looking things up online, before I decided that it was too difficult and I’d put it off again. The other night, I went and got coffee with an old friend to catch up. She’s worked with games a lot and she encouraged me to give it another stab. She also gave me some tips on what a good first game would be to write and how to distill it down to a simple idea.
I also did not use a physics engine for my first game. Even though there is an excellent 2d physics engine, I decided to try implementing gravity and collision detection myself, just to get a feel for it. Gravity wasn’t all too difficult to implement; I mostly dropped in the intro physics formula for distance, acceleration and velocity and tweaked the coefficients until it “felt” right. Playing with the actual numbers was probably the hardest part. Collision detection was another story. Originally when I started out, I had red and blue squares representing the whale and sharks. Collision detection was really easy then. But then when I added the animations (all sprites designed and drawn by this guy, and the whale became a funny shape, collision detection became harder. I ended up just adding some “squish” where the whale and shark have to overlap by more than a certain number of pixels to register a collision to make up for the whale’s rounded belly. There’s probably a better way to do this, but I’ll leave that to developers of real physics engines.
All in all, this was a great experience. Have fun playing!