This site requires JavaScript, please enable it in your browser!
Greenfoot back
Bean4221
Bean4221 wrote ...

2014/1/22

Cannot find symbol "canSee"

Bean4221 Bean4221

2014/1/22

#
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); } } }
Bean4221 Bean4221

2014/1/22

#
never mind, found it out XD
You need to login to post a reply.