Click here to Skip to main content
10,500,000 members (42,579 online)
Click here to Skip to main content
Add your own
alternative version


16 bookmarked
Posted 24 Apr 2004


, 24 Apr 2004
Rate this:
Please Sign up or sign in to vote.
A strategy game that you must think twice before you move because you can't go back. Face 14 Levels of exciting.

Sample Image - Marbles.jpg


Marbles is a strategy game for smart devices to the smart users. The idea is taken from an old game called Marbles Deluxe.

How to play

The goal of the game is to move the ball to get all jewels then go to the target block. While doing this, you can switch pairs of blocks to make space for the ball.

Click on a block to select it then click it again to move the ball to this block, or click another block to switch the two blocks.

Some blocks cannot be switched like the target and the jewels. Some blocks will kill you like the skull block. Some blocks will move you like the arrows blocks.

Take care blocks vanish after you move on them. You will not be able to go backward. Except white blocks, you can hit them two times before they vanish.


The code is readable and contains comments that don't need explanation except for some bug fixes. The Game contains two classes:

Marbles: which is the main form of the application and has all the interactivity of the game and its rules.

Board: which has the information of the game and how to save it and load it.


Images for the game were created using 3D studio MAX 5. I'm a graphics designer too.

To create more levels

You can create your own editor for the game levels on a smart device or a normal windows application. To create the editor you will use the Board class and fill it with numbers of the images that are provided in the source project. Then save the file by calling the function void Board.Save(string file).

This is the code for saving the level after editing:

void Save(string file)
 StreamWriter r=new StreamWriter(file);

 for(int y=0;y<Height;y++)
  for(int x=0;x<Width;x++)

If you like it, please vote for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Bishoy Labib
Team Leader Link Development
Egypt Egypt

You may also be interested in...


Comments and Discussions

GeneralBUG: Hardcoded Path Pin
Steffen Lange27-Sep-08 7:50
memberSteffen Lange27-Sep-08 7:50 
GeneralHi Pin
yahtra1-Jul-07 21:48
memberyahtra1-Jul-07 21:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170924.2 | Last Updated 25 Apr 2004
Article Copyright 2004 by Bishoy Labib
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid