Hello there!
A quick question:
I have two different actors, one for each player. One is controlled with the arrow keys, the other with A, W, S, D.
I have a power up and I need it to disappear and play a sound while doing so whenever it's intersecting with one of the actors. This is easy if I only have one Bomberman.class. I simply can't get it to work with BOTH the Bomberman.class and the Bomberman2.class.
This is my powerUp code:
public void act() { //Deletes the powerup if it intersects with the Bomberman actor. Actor onePowerUp = getOneIntersectingObject(Bomberman.class); if (onePowerUp != null) { getWorld().removeObject(this); //The splooge.wav sound effect is then played. Greenfoot.playSound("splooge.wav"); } }