绘制游戏键盘就像在Android的跳棋 [英] Drawing a gameboard like checkers in Android

查看:108
本文介绍了绘制游戏键盘就像在Android的跳棋的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设计一个游戏键盘如跳棋(但具有不同的板瓦片的可能性。

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

现在,面向对象的逻辑和理性告诉我,我应该有,我可以得出一个砖类,我画通过这些Ÿ数x在一个画布上。

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 such 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?

谢谢!

推荐答案

我想你可能会从检查出来的蛇游戏code为Android受益。它使用的瓷砖,使游戏领域的一个非常直接的方式。

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.

这篇关于绘制游戏键盘就像在Android的跳棋的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆