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

2011/10/16

Help with import greenfoot.* (I think)

ardwennem2 ardwennem2

2011/10/16

#
Hello, I'm quite new with Greenfoot, so I started by reading the tutorials, however, already with the first thing I try to do I get an error ( cannot find symbol - method move() ) The only thing I've done is literaly copy the statement, so could anyone tell me why it doesn't work? (turorial: http://www.greenfoot.org/doc/tut-2)
danpost danpost

2011/10/16

#
The method move() would be something the user would have to write. What you may have intended, on the other hand, is the method move(int), where you must specify how far to move the object. From what I can tell from the error message you got, you only need put a number in the round brackets '( )'. If that is not the case, you may want to reply and include what code you have so far.
ardwennem2 ardwennem2

2011/10/16

#
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) public class Crab extends Actor { /** * Act - do whatever the Crab wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { move(4); } }
ardwennem2 ardwennem2

2011/10/16

#
that's the entire thing (except the world)
danpost danpost

2011/10/17

#
If your crab appears on the right side of the world, it may be possible that your speed setting is set too high to actually see the movement. If this is the case, move the speed slider half the distance toward to left end and run the scenario again. BTW, the code looks good, and should work.
ardwennem2 ardwennem2

2011/10/17

#
I already get the message when I try to compile the code, so either my crab goes away, or I can't place one...
nccb nccb

2011/10/17

#
ardwennem2: which version of Greenfoot are you running? The tutorials rely on you having at least 2.1.0, which added that move(int) method, so the most likely problem is that you're running an old Greenfoot.
ardwennem2 ardwennem2

2011/10/17

#
aha... thanx, that will probably be the cause... thanx again yes... it works -.-
You need to login to post a reply.