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

2011/12/6

What i have to do??

TopInPut TopInPut

2011/12/6

#
public void special() {
public void special() {
        Actor TeamGelb = getOneObjectAtOffset(TeamGelb.class, xOffset, yOffset);
        if(TeamGelb == null) {
            move();
        } else {
        }
    }
Now Greenfoot says : "Cannot find symbol - variable xOffset" (Sry for my questions, i am beginner with greenfoot.;) )
TopInPut TopInPut

2011/12/6

#
What's wrong? :(
TopInPut TopInPut

2011/12/6

#
Do i have to create the variable int xOffset ? And if yes, how to define THAT variable ?
TopInPut TopInPut

2011/12/6

#
getImage().getWeight(); ??
danpost danpost

2011/12/6

#
The information you need is in the Greenfoot tutorials, here . You should, as a beginner, go through the tutorials. You can get to them through the Documentation link within Greenfoot.
davmac davmac

2011/12/7

#
Also, it is helpful if, when you ask a question, you explain what the code is supposed to do :) In short the problem is that you have a reference to something called "xOffset" but there is no such variable. You could, as you suggest, create the variable, but you could also simply supply a value at the call site, eg: Actor TeamGelb = getOneObjectAtOffset(TeamGelb.class, 0, 0); Of course you might need a different offset than (0,0) but since you haven't told us what you are trying to do with this code, I don't know if this is really a suitable solution, or what offsets you should use.
TopInPut TopInPut

2011/12/7

#
Ok:;D
You need to login to post a reply.