There was this old game (J2ME) but I cannot find it now in google.
The name was "Capture".(Accoring to the comments it's more like "Jezzball")
I tried to implement this game but I cannot come up with a good algorithm and data structues.
The ideas of the game is,
Can anyone suggest an algorithm?
(I hope the ideas is clear)

- 2,067
- 6
- 30
- 47
-
2Looks very similar to good old [Jezzball](http://www.youtube.com/watch?v=4T3q2sxG5xI) for Windows :-) – aioobe Oct 04 '11 at 09:46
-
2This game is *way* older than J2ME: http://www.mobygames.com/game/qix – NPE Oct 04 '11 at 09:47
-
What do you mean by "suggest a design for this game"? – aioobe Oct 04 '11 at 09:50
-
I mean what would be the algorithm ? ( forget the graphics, user inputs ). Like a pseudo code. And yes it's very similar to Jezzball – Dinushan Oct 04 '11 at 09:52
-
2You should probably file a (more detailed!) question under http://gamedev.stackexchange.com – Constantinius Oct 04 '11 at 09:53
2 Answers
By algorithm, I guess you mean the design of the program. You would end up using several algorithms in the final game.
You would design this the same way you'd tackle any piece of software (there's nothing special about it being a game). First, you'd start with a specification, which you have. Then, you'd break it down into logical units:
- the board
- the player
- the enemies
and then you'd consider how they interact. For example, when the player moves, the board is updated. When an enemy moves, it checks the board to see if it has collided with the player. And so on.
As for the structure of the game, every game I've worked on does this:
set up the world
while (playing)
{
draw the world
update the world
}
In your case, the world
would be the board, the player and the enemies (it would also include the UI). There is a hierarchy here, the player and the enemies belong to the board, so you get:
create_board
while (playing)
{
draw_board
update_board
}
and draw_board
is:
draw_background
draw_player
draw_enemies
and update_board
:
update_player
update_enemies
The update_
and draw_
functions can be further broken down. This is know as top down design.
Designing the whole game for you would require a huge answer, and it would take away from you the fun of figuring these out for yourself. Hopefully this will get you started.

- 69,698
- 10
- 71
- 108
-
thank you ."and it would take away from you the fun of figuring these out for yourself." I'll try some more. I guess a data representation of the 'board' would be a starting point. – Dinushan Oct 04 '11 at 10:50
-
1@D-Shan: That would be a good place to start. You could also look into [unit testing](http://en.wikipedia.org/wiki/Unit_testing) and add test cases to the board code. – Skizz Oct 04 '11 at 11:45
At last I found a similar game+sourcecode.allegro.cc/depot/Jezzball/
Not to "copy" the code but have a start/idea as I struck there for months.
and this answer also is a good start.