My very first sports game! A simple basketball game. Get the ball into the basket. No nonsense, really. The physics for this game was relatively simple. And fun. But then again, physics is always fun.

The key here is to setup a good aiming system. The game builds itself around that. One of the best solutions is to represent exactly half the parabolic path of the ball. The player will still have to judge the path of the ball, but the portion that we show on the screen would give him an idea of the velocity and angle.

Our interest is in calculating the path of the ball, which is determined by two parameters:

  • The velocity
  • The launch angle

Given that the mouse pointer represents the highest point on the parabolic path, both launch velocity and launch angle can be calculated. It’s really simple (should you have taken physics in high school).

Parabolic path of the ball


In the above equations R is the range of the projectile and H is the maximum height to which it rises. It’s easy to see why, for a given position of the mouse, R and H are constants that can be calculated. Rearranging and solving these equations will give us the velocity and angle which is what we need to describe the motion. The velocity will then be resolved into components, for convenience.

The game depends on a few libraries like SOIL for texture loading, freeglut for openGL and irrKlang for audio.

Coming up next is a version with highscore tables! Gotta learn a little php for that 😛

Edit: High score table is live but a little buggy.

Available on gumroad:


Falling Balls listed on

Falling Balls, which recently got listed on, is now also listed at! It’s got about 9 downloads so far.
Visit the page or directly download: 

Tic Tac Toe OR (X & O, if you like it that way)

Who hasn’t played Tic Tac Toe ?

Also know as Noughts and Crosses, its one of the best games to fill those idle moments, any-place, any-time!

Having previously written a console version of the same game, I thought it would be cool to rewrite the game with GUI elements, and to update the logic a little bit.

Tic Tac Toe is really easy to program, even for a newbie.  Try your own hand at it, or look through the source code to get some tips.

See the animation below:

It’s not that hard to get the hang of. First person to get 3 X’s or O’s in a row wins!

Download the game

Get the source