How can I get a boolean from a specific object (this) into another class?
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Bullet here. * * @author (your name) * @version (a version number or a date) */ public class Bullet extends Actor { /** * Act - do whatever the Bullet wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public static double enemieskilled; public static int b; int c; public void act() { move (10); if (isTouching(Border.class)) { removeTouching (Bacteria.class); getWorld().removeObject(this); } else if (isTouching(Bacteria.class)) { removeTouching (Bacteria.class); getWorld().removeObject(this); enemieskilled++; } else if (isTouching(Tumor.class)) { if (Tumor.badtumor == false) { removeTouching (Tumor.class); getWorld().removeObject(this); enemieskilled++; if (Bacteria.bacteria > 2) { Bacteria.bacteria--; } if (Virus.virus > 3) { Virus.virus--; } } else { if (Bacteria.bacteria < 4) { Bacteria.bacteria++; } if (Virus.virus < 5) { Virus.virus++; } } } else if (isTouching(Virus.class)) { removeTouching (Virus.class); enemieskilled++; if(Greenfoot.getRandomNumber(100) < 30) { c = Greenfoot.getRandomNumber(5); switch(c) { case 0: nuke(); NukeScreen object1 = new NukeScreen (); getWorld().addObject(object1, 350, 50); object1.nukeScreen(); MyWorld.p++; break; case 1: Player.timerA = Player.timerA + 300; Player.k = 5; FasterShootingScreen object2 = new FasterShootingScreen (); getWorld().addObject(object2, 250, 50); MyWorld.p++; break; case 2: Player.timerA = Player.timerA + 300; Player.k = 5; FasterShootingScreen object3 = new FasterShootingScreen (); getWorld().addObject(object3, 250, 50); MyWorld.p++; break; case 3: MyWorld.freezeTimer = MyWorld.freezeTimer + 400; FreezeScreen object4 = new FreezeScreen (); getWorld().addObject(object4, 450, 50); MyWorld.p++; break; case 4: MyWorld.freezeTimer = MyWorld.freezeTimer + 400; FreezeScreen object5 = new FreezeScreen (); getWorld().addObject(object5, 450, 50); MyWorld.p++; } } getWorld().removeObject(this); } else if (isAtEdge()) { getWorld().removeObject(this); } } public void nuke() { if (getWorld() != null) { getWorld().removeObjects(getWorld().getObjects(Bacteria.class)); getWorld().removeObjects(getWorld().getObjects(Virus.class)); } } }