开发者

Drawing a gameboard like checkers in Android

开发者 https://www.devze.com 2023-01-17 07:19 出处:网络
I want to design a gameboard such as Checkers (but with the possibility of having different board tiles.

I want to design a gameboard such as Checkers (but with the possibility of having different board tiles.

Now, OO logic and reason tell me I should have a 'tile' class which I can draw, and I draw x by y number of these on one canvas.

My question is what is the best performant way to draw suc开发者_如何学编程h a board? Is it reasonable to do it the way I mentioned above and re-draw on changes? Is it better to have an image as my background and 'simulate' a board by snapping to where the tile would be?

Thanks!


I think you might benefit from checking out the snake game code for android. It has a very straight forward way of using tiles to make a game area.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号