2-d side scroller using allegro

Hello everyone,

I am kind of a newbie to game programming, i am looking to code a 2-d side scroller which could do such things :

- As the game begins, the ball starts rolling from left to right, and speeds up as the time goes on.
- In its path, it faces obstacles like Triangles and Squares and combination of the two at random distances.
- The player needs to jump the ball over the obstacles, suppose he hits the triangle he loses a life and stops if he hits a square and needs to jump over it, roll on the top and go ahead.

I need to code this very urgently, and i am confused in the proper C++ and ALLEGRO coding for

1. JUMP

2. Random Triangles and Squares.

Waiting for your replies.