I need help with a Zombie Survival Game.
I want to write that if the currentX and Y of the bullet the same is like of the Zombies the Zombie have to be removed and the bullet too.
would be nice if i get some help :)
Actor Bullet;
Bullet = getOneObjectAtOffset(0, 0, Bullet.class);
if (Bullet != null)
{
World world;
world = getWorld();
world.removeObject(this);
world.removeObject(Bullet);public void sterben()
{
Kugel kugel;
kugel = getOneObjectAtOffset(0, 0, Kugel.class);
if (Kugel != null)
{
World world;
world = getWorld();
world.removeObject(this);
world.removeObject(Kugel);
}
}Bullet = getOneObjectAtOffset(0, 0, Bullet.class);
public void sterben()
{
Kugel kugel;
kugel = getOneObjectAtOffset(0, 0, Kugel.class);
if (kugel != null)
{
World world;
world = getWorld();
world.removeObject(this);
world.removeObject(kugel);
}
}public class Zombie extends Actor
{
public static int currentZombieX;
public static int currentZombieY;
public static int leben = 100;
/**
* Act - do whatever the Zombie wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
AutoAiming();
currentZombieX = getX();
currentZombieY = getY();
}
public void AutoAiming()
{
turnTowards(Roboter.currentX, Roboter.currentY);
move(1);
}
public void sterben()
{
Actor kugel;
kugel = getOneObjectAtOffset( 0, 0, Kugel.class);
if (kugel != null)
{
World world;
world = getWorld();
world.removeObject(this);
world.removeObject(kugel);
}
}
}public class Kugel extends Actor
{
private boolean getAngle = true;
/**
* Act - do whatever the Kugel wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
angleSelect();
move(10);
}
public void angleSelect()
{
if (getAngle == true)
{
setRotation(Roboter.currentRot);
getAngle = false;
}
}
}