This is for a project, and I'm kinda new to programming so I'm having lots of problems. I'm making a car game and I wanted to add 3 lives, which disappear each time the player's car bumps into a roadcar. I've added 3 objects at the top of the screen, and I've only managed to make 1 heart disappear if the car collides. The other 2 remain in place.
That's the car's method.
And I've added 3 objects in CarWorld.
addObject(new Lives(),574,23);
addObject(new Lives(),531,23);
addObject(new Lives(),487,23);
Any kind of help would be appreciated xx.
public void checkCollision()
{
Actor collided = getOneIntersectingObject(RoadCar.class);
if(collided != null) {
Greenfoot.playSound("Explosion.wav");
getWorld().removeObjects(getWorld().getObjectsAt(487, 23, Lives.class));
}
