My code is very basic and Im new to this, but it keeps saying "Reached end of file while parsing" And I have no idea what that means
Can someone tell me whats wrong?
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Ant here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Ant extends Actor
{
/**
* Act - do whatever the Ant wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
moveAndTurn();
eat();
}
public void moveAndTrun()
{
move(4);
if (Greenfoot.isKeyDown("a"))
{
turn(-5);
}
if (Greenfoot.isKeyDown("d"))
{
turn(5);
}
}
public void eat()
{
Actor food;
food = getOneObjectAtOffset(0,0, Food.class);
if (food!=null)
{
World world;
world = getWorld();
world.removeObject(food);
}
}