【发布时间】:2012-11-14 08:31:33
【问题描述】:
hy 我正在开发 android 游戏,即 LUDO 游戏。 我使用了四种不同的数组来获取 LUDO Board 在 Hit and trail mwthod 上的位置。
四个不同的数组如下。
int[] t_LM = { 60, -44, 17, -46, 155, -44, 17, -46, -201, -44, 17, -46,
155, -44, 17, -46 };
int[] t_TM = { 42, 63, 63, 85, 42, 63, 63, 85, 233, 254, 254, 275, 233,
254, 254, 275 };
int[] t_o_LM = { 38, -57, -57, -57, -57, -57, 3, -27, -27, -27, -27, -27,
3, -27, -27, -27, -27, -27, 3, 3, 3, 3, 3, 3, -27, -57, -207, 3, 3,
3, 3, 3, -57, -27, -27, -27, -27, -27, -57, -27, -27, -27, -27,
-27, -57, -57, -57, -57, -57, -57, -27, 3 };
int[] t_o_TM = { 200, 275, 275, 275, 275, 275, 305, 337, 369, 401, 432,
464, 464, 464, 432, 401, 369, 337, 305, 275, 275, 275, 275, 275,
275, 242, 209, 209, 209, 209, 209, 209, 177, 146, 115, 83, 51, 20,
20, 20, 51, 83, 115, 146, 177, 209, 209, 209, 209, 209, 209, 242 };
LUDO板的图片如下
但是当我在模拟器的屏幕上获得坐标和地图时,它会像这样显示..
图中粉色、黄色和绿色的方框是我在Hit and trail方法后得到的坐标。
非常感谢任何有助于解决此问题的软件或链接。
提前致谢
【问题讨论】:
-
至少对我来说,完全无法理解你的问题......
-
你需要照顾每个手机屏幕的密度。
-
矩形的公式。本地图片坐标到手机坐标 其中pVertices[0] = px; pVertices[1] = py; public void transformLocalToScene(final float[] pVertices) { int count = pVertices.length / 2;诠释 i = 0;整数 j = 0; while(--count >= 0) { 最终浮点 x = pVertices[i++];最终浮点 y = pVertices[i++]; pVertices[j++] = x * this.a + y * this.c + this.tx; pVertices[j++] = x * this.b + y * this.d + this.ty; } }
-
嗨。我在ludo游戏开发中遇到问题。我无法根据骰子滚动移动令牌。如果骰子显示2,那么令牌将向前移动两个位置。你能给我一些想法吗it.谢谢你的回复
标签: android android-layout android-intent android-emulator