I can't figure out how to do this I have an actor called Bee, and I want the counter to count double if the actor Bee hits the Actor balloon, I have tried coding it within the world but you can't define getoneobjectatoffset in the world and, so I need to program it within the code of the bee here is my code so far:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Bee here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Bee extends Actor
{
private Counter actCounter;
/**
* Act - do whatever the Bee wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if(Greenfoot.isKeyDown("down"))
{ setRotation(90);
move(1);
setRotation(0);
}
if(Greenfoot.isKeyDown("Up"))
{
setRotation(270);
move(1);
setRotation(0);
}
Actor Bomb = getOneObjectAtOffset(0,0, Bomb.class);
if (Bomb!=null)
{
Greenfoot.setWorld(new TheWorld());
System.out.println("Game Over");
}
Actor Balloon = getOneObjectAtOffset(0,0, Balloon.class);
if (Balloon!=null)
{
actCounter.setValue(actCounter.getValue() + 1);
}
}
}

