public class Team {
public int health;
public int x;
public int conflict;
}
public class Test extends Activity {
Team enemy[] = new Team[50];
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
for(int i =0; i<enemy.length; i++){
enemy[i].health = 0;
enemy[i].x = -100;
enemy[i].conflict = 0;
}
}
}
隨着for循環我的遊戲崩潰,沒有for循環運行。我究竟做錯了什麼?感謝您提前幫助!對象數組for循環
-1因爲一些非常簡單的調試就可以解決這個問題。 – 2011-12-22 20:31:49