Help me developing this logic

hi guys

I wanna develop this game http://www.miniclip.com/games/roly-poly/en/…after doing 3-4 days of r&d on it i still wont able to find its logic…guys i really need ur help on it.help me on developing its logic. i am not asking for its code just guide me to the right way.