【发布时间】:2012-12-12 08:39:45
【问题描述】:
每当一个盒子,从 arraylist 形状,到达一个指定的位置,它必须从 arraylist 中删除。但它似乎不起作用,我做错了什么?
if(!box.removing && box.y == MoveY - 50 && MoveX != box.x) {
box.removing = true;
score += 10;
System.out.println(shapes.indexOf(box));
shapes.remove(shapes.indexOf(box));
} else {
// Gravity loop, if not reached the position. This work.
box.update(1);
}
【问题讨论】:
-
shapes.indexOf(box) 给出了正确的值?
-
大声笑 ;) 你问我“shapes.indexOf(box) 是否给出正确的值”我说是的,伙计 ;)
标签: java object arraylist lwjgl