We all love to play marbles. Well most of you may have played it at some or other time in your childhood. Let us try to re-create the magic of playing glass marbles.
Let us try to create a marbles playing simulation. I have downloaded some images of glass marbles from the internet and used them in this project. There are plenty of them. You can not understand how this game is created unless you play it first and then look in the code that goes in it on the MIT's Scratch website. Here is the link for the project's Homepage.
I will explain the way I have created this small game. Do not try to compare this game with the one's that you play online. This is a Games programming Tutorial. If I show you a fully functional game you may be turned away by just looking at the coding that went in it.
This tutorial is designed to help you to understand the Scratch programming and how to implement Games Ideas into actual coding. So we will go one step at a time.
I have created this game with two levels. The game functions as follows.
There is a blue marble which acts as the Striker. You can control the striker with your four arrow keys. Each level has three marble each. The marbles in each level are different. The physics that governs them is also different. The first set are lighter marbles. And the second set are bigger/heavier marbles.
When you touch the striker to any of the marbles, they move a fixed number of pixels and turn anticlockwise a certain degrees. Each marble acts differently.
You are supposed to push the marbles into the Hole in the middle of the screen. But keeping the striker away from the Hole. If the striker falls in it then the game is over.
Once you push all the three marbles in the Hole, then the next level begins and you will see another set of marbles. If you manage to push them all into the Hole then the Game is successfully over.
If you can look into the code, then you will understand how I have implemented the above idea of the game in actual coding.
So watch the Project's Homepage and have fun.