Hey guys, I want to thank you for helping me out lately. I've been able to get quite a bit of coding for my project done thanks to you. Now I'm running into a new problem and I'm not even sure how to discribe it... This is my code:
And this is the code of 'DESERTWALKER'
So my problem is in 'addEnemies'. Somehow it doesn't know help.die, however the code does place the enemies correctly and they use the code they should. Any ideas on the source of the problem or a way to fix it? Please advice.
public void EnemyWalker(int x, int y) { list.add(new DESERTWALKER()); coor.add(x); coor.add(y); //addObject(new DESERTWALKER(), x, y); } public void EnemyThrower(int x, int y) { list.add(new DESERTTHROWER()); coor.add(x); coor.add(y); } public void addEnemies() { int counter; for(counter=0; counter<list.size(); counter++) { Actor help = list.get(counter); //which should make 'help' into 'new DESERTWALKER' or 'new DESERTTHROWER' if(help.die) //for some reason this doesn't work. it doesn't know die addObject(help, coor.get(counter*2), coor.get(counter*2+1)); //0=x, 1=y, 2=x, 3=y and so on } }
public class DESERTWALKER extends WALKER { public static boolean die=false; boolean goingLeft=true; int dead=0; int speed=5; public void act() { Move(speed); Die(); } }