So I want to know how i can get my enemy moving random and cheking for walls
Also he should check for Spieler(Player). When it is true he should start shooting.
Is that somehow possible?
As far as I am. :S
public void RandomBewegung()
{
int random;
int richtung;//direction
random = Greenfoot.getRandomNumber(4);
if (random==0)
{
richtung = 0;
if (random == 1)
{
richtung = 90;
if (random == 2)
{
richtung = 180;
if (random == 3)
{
richtung = 270;
}
}
}
}
}
public void checkWand()
{
int dy=0;
int dx=0;
if (dx*dy != 0 || dx+dy == 0)
{
return;
}
setLocation(getX()+dx*2*Tempo, getY()+dy*2*Tempo);
if (isTouching(Wand.class))
{
setLocation(getX()-dx*2*Tempo, getY()-dy*2*Tempo);
}
}
