Design for a simple Board Game - help

Put your problem here if it does not fit any of the other categories.

Design for a simple Board Game - help

Postby ragingdave » Tue Jan 11, 2011 12:19 pm

First i wanted to say hi since this is my first post.

I already read a lot on this forum and it's a great place! Lots of useful hints here.

My problem is the following:
I want to create a board game for android similar to checkers.
I've already implemented the engine and some basic BoardView class.

I encountered a problem with the invalidate() function and searched the web a whole day for help. It doesnt update when the player has moved a piece but waits for the engine to make a move first.

I found some tutorials explaining a standard game loop like this one: ... -game-loop

I wonder if that approach makes sense for a turn based board game. Since the polling of the "worker" thread consumes cpu and battery power and isnt needed with my understanding. Also i implemented my game with a simple View not SurfaceView since i thought it would fit all my needs.

So isnt it possible to design a simple app like this:
- a view for the board
- an engine which handles moves
- no extra thread which polls all the time (or periodically)

The Boardview should just do this:
- when an onTouchEvent occures it moves the piece and redraws the board
- then it commands the engine to calculate a move, processes it and redraws

Sorry for this long text.. but i would appreciate your help very much. If you have any tutorials that handle a turn based game without constant polling or have any other advice on the design of the app pls write!

thank you,
~ Visit my blog for some news regarding my Android development ~
*** ***
Posts: 6
Joined: Tue Jan 11, 2011 12:05 pm


Return to Other Coding-Problems

Who is online

Users browsing this forum: Google Feedfetcher, MSNbot Media and 16 guests