【发布时间】:2012-12-16 22:03:15
【问题描述】:
我想知道有人帮助我如何实现 bug Smasher 简单功能, 我想从上到下移动图像,并想在有人点击图像时更改图像,就像 Bug Smasher Game 一样。我知道 SurfaceView n 能够在 SurfaceView 上绘制图像。
代码,示例?
请帮忙。
谢谢
【问题讨论】:
标签: android image bitmap surfaceview
我想知道有人帮助我如何实现 bug Smasher 简单功能, 我想从上到下移动图像,并想在有人点击图像时更改图像,就像 Bug Smasher Game 一样。我知道 SurfaceView n 能够在 SurfaceView 上绘制图像。
代码,示例?
请帮忙。
谢谢
【问题讨论】:
标签: android image bitmap surfaceview
请提供更多信息并编码您如何移动图像。也许我的一个项目的这个小例子会对你有所帮助。
float x = 0,y = -1;
public void onDrawFrame(GL10 gl)
{
float delta = 0;
long currentFrameStart = System.nanoTime();
if(lastFrame!=0)
delta = (currentFrameStart-lastFrame) / 1000000000.0f;
lastFrame = currentFrameStart;
antTexture.bind();
gl.glPushMatrix();
y += delta*0.1f;
gl.glTranslatef(x, y, 0 );
//gl.glRotatef(angle, 0, 0, 1);
antMesh.render(PrimitiveType.TriangleFan, 0, 4);
gl.glPopMatrix();
}
我在我的游戏 Orc Genocide 中实现了 Ant Smasher 的迷你游戏版本
【讨论】: