【发布时间】:2012-05-06 07:36:14
【问题描述】:
我最近开发了一款适用于 Android 2.3.3 的游戏,但奇怪的是我发现很少有不同手机中的奇怪行为,
例如
分解为 4x4=16 图像的爆炸精灵(256x256 像素),在 Samsung Galaxy Ace 2.3.3 和 Samsung Galaxy Y, 2.3.5 中显示为 2x2 图像,
此外,加速度计在 Sony Xperia 2.3.3 和三星 Galaxy Ace 中以随意的形式工作。要么太慢(并且在 3-4 秒间隔后进行触摸手势),而且 Android 操作系统会抛出警报框说,应用程序没有响应,否则它太快了。
奇怪的是,游戏在三星 S2 上完美运行,就像在 VirtualBox 上玩一样..
请帮帮我,因为这是我的大学项目,如果存在这种奇怪的问题,我什至无法将其投放市场!!
提前致谢!!
【问题讨论】:
-
您能发布一些用于绘制爆炸精灵的代码吗?
-
您指的是哪款 Sony Xperia 设备?
-
int srcX = column * width_explosion; int srcY = 行 * height_explosion;矩形 src = new Rect(srcX, srcY, srcX + width_explosion, srcY + height_explosion); Rect dst = new Rect((int) (x1 - width_explosion / 2), (int) (y1 - height_explosion / 2), (int) (x1 + width_explosion / 2), (int) (y1 + height_explosion / 2)) ; canvas.drawBitmap(random_explosion, src, dst, null);列 = ++列 % 4;如果(列 == 0){ 行++; } if (row == 4) { explode_drawn = true;行 = 0; }
标签: android sprite accelerometer