I'm trying to make a simple game, and I'm trying to get a player to take a "GoldCoin" whats wrong with the code!?!??!
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Charecter here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Charecter extends Actor
{
private Counter counter;
public Charecter(Counter pointCounter)
{
counter = pointCounter;
}
/**
* Act - do whatever the Charecter wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if (Greenfoot.isKeyDown("W"))
{
move(4);
}
if (Greenfoot.isKeyDown("S"))
{
move(-4);
}
if (Greenfoot.isKeyDown("A"))
{
turn(-3);
}
if (Greenfoot.isKeyDown("D"))
{
turn(3);
}
if(canSee(GoldCoin.class))
{
eat(GoldCoin.class);
}
}
}