Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android board game implementation design

Tags:

java

android

I'm working on implementing an android version of the board game Cloud 9. I have never designed games, android apps (except 1-2 hello world apps) or even programs with GUI before (did a lot of CLI), and I have some questions regarding the design.

The game is turn-based, so there's no real-time considerations here, and I was wondering what was best to do. The game consists of pretty simple 2-3-options selections for each decision the player has to make, and for starters I want to make it "text-based", i.e., have a TextView with the game "log" on it and whenever the human player has to make a decision, he is given 2-3 buttons with the options he can play. The game consists of several rounds and levels.

I started out implementing the game "core" without a GUI altogether and with AI players. I then tried to figure out how to allow for human players, GUI, etc. My current design idea is a GameEventListener class which will be informed of different events in the game (round begins, round ends, a certain player did a certain action, etc.), and have the activity implement it and thus it can draw/write to the screen what happens, etc.

However, I'm not sure if this is the best approach, and how the Android part should be implemented (for example, I would like that after some events, the player will have a "continue" button, so he can see what was done before the game continues - how do I wait for the button to be pressed? If I return from the listener function, the game will continue). Any suggestion on how to proceed?

like image 490
Amir Rachum Avatar asked Feb 24 '26 16:02

Amir Rachum


1 Answers

You can take a look at my Tetrads Drop game here for GUI and some of my approach http://code.google.com/p/tetrads-drop-lite/ It is a tetris clone and can play with another player over the internet. If you need help with some GUI code, Ed Burnette's "Hello, Android" is a good book to start.

Updated

It is quite similar to what you are designing.

There are these package hierarchies

-com.aunndroid.Engine  (handling game logic) 
-com.aunndroid.View    (managing 2D Views)
-com.aunndroid.Tolk    (communication between deivces)
like image 150
Win Myo Htet Avatar answered Feb 26 '26 05:02

Win Myo Htet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!