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

2012/10/13

Hello everyone.

Minion1 Minion1

2012/10/13

#
This is my first post here, and to commemorate the moment, I'm going to ask the noobiest noob question that most of you will ever see. I woke up this morning all excited, I've dedicated the whole day to programming a game. Alas, my first entry into the game is: public void canSeeEnemy() { if (canSee(Enemy.class)) { blah blah } } The workings inside of the method are meaningless, they're what I hope to work on. The problem is that Greenfoot can't seem to find the canSee method! I don't get it, I've been stuck on this for hours and it's really bothering me. We've been using the damn canSee method since the class freaking began! Why can't it find it now??
-nic- -nic-

2012/10/13

#
is the class your working in extend Animal?
MatheMagician MatheMagician

2012/10/13

#
is the canSee method in your class?
-nic- -nic-

2012/10/13

#
yes
-nic- -nic-

2012/10/13

#
[Disallowed URL]
Minion1 Minion1

2012/10/13

#
Sorry, I forgot to post the exact error message. It says: cannot find symbol - method canSee(java.lang.Class<Enemy>) I've been scouring the API looking for the canSee method and I can't find it either. I feel stoopid. Anyone else ever have this problem?
Minion1 Minion1

2012/10/13

#
The class extends Mover, which extends Actor.
Minion1 Minion1

2012/10/13

#
I cannot find the canSee method anywhere.
Minion1 Minion1

2012/10/13

#
I went back to the original games (the crab game, the bug games) and looked for the method, but as near as I can see it's been used in the exact same way. No method definition, I just assumed that it is part of the Greenfoot API.
-nic- -nic-

2012/10/13

#
you need to import the animal class to use the method
Minion1 Minion1

2012/10/13

#
Wait! I think I've found the problem. Man I feel stupid. Sorry guys.
-nic- -nic-

2012/10/13

#
go to the top left of the greenfoot window and there should be a button that says edit pres that then press import class and prees on the animal import it
-nic- -nic-

2012/10/13

#
its okay ive done some stupid facepalmy things we all do its the learning curve
Minion1 Minion1

2012/10/13

#
Yeah, got it fixed. I missed the method definition inside the mover class. Sorry to ask a dumb question. Of course, I'll be asking many more before I'm done. I want to make a dungeon crawler.
-nic- -nic-

2012/10/13

#
oo that sounds sounds good will it be top down?
You need to login to post a reply.