\你好。
我需要帮助我的游戏我设计无界的游戏。杀坏人,不杀好,我的比赛包括12个字符,6好,6坏,当我杀了,好女人应该出现的尖叫声和红细胞取代,2秒后血液中清除,所以我的问题是,当我杀好或坏的另一个必须出现,而不是人杀害一人。
我会把触摸事件和代码附加字符代码
感谢
注:雪碧,温度是从这个数组列表class.iused他们插入IMGS主题的
这附加精灵的代码:
@Override
public boolean onTouchEvent(MotionEvent event) {
if (System.currentTimeMillis() - lastClick > 300) {
lastClick = System.currentTimeMillis();//Long Variable to calculate time
float x = event.getX();
float y = event.getY();
synchronized (getHolder()) {
for (int i = charc.size() - 1; i >= 0; i--) {
Characters sprite = charc.get(i);
if (sprite.isCollition(x, y)) {
charc.remove(sprite);
temp.add(new TempToRemove(temp, this, x, y, bmpBlood1));
break;
}
}
for (int i = chara.size() - 1; i >= 0; i--) {
Characters sprite = chara.get(i);
if (sprite.isCollition(x, y)) { chara.remove(sprite)
temp.add(new TempToRemove(temp, this, x, y, bmpBlood));//tempToRemove is object from class to put blood instead of the character.
break;
}
}
}
}
return true;
}
{C}与此功能布面漆:protected void onDraw(Canvas canvas) {
canvas.drawColor(Color.BLACK);
for (int i = temp.size() - 1; i >= 0; i--) {
temp.get(i).onDraw(canvas);
}
for (Characters sprite : charc) {
sprite.onDraw(canvas);
}