This site requires JavaScript, please enable it in your browser!
Greenfoot back
Back to discussions
Darkmauro
Darkmauro wrote ...

2017/11/14

Terminal Window

Darkmauro Darkmauro

2017/11/14

#
Please help me, now I'm trying to make a sustitution of classes, however, when I want to put the new Object it opens the Terminal Window, this is the error line.
mundo.addObject(mundo.ka,getX(),getY());
Darkmauro Darkmauro

2017/11/14

#
Please
danpost danpost

2017/11/14

#
Not enough information/code given. There are multiple possible errors you could get from the line and there is no context to go on (meaning that you need to be specific as to what error you are getting and you need to supply much more code than the one line (best is to supply the entire class and copy/paste the error message).
Darkmauro Darkmauro

2017/11/14

#
Complete code:
public class cai extends animator
{
    int a,b,c;
    MyWorld mundo;
    public cai()
    {super("ni",".png",6);
    }
    protected void addeToWorld(World w)
    {mundo=(MyWorld)w;
    }
    public void act() 
    {
        play();
        retardo=7;
        if(isEnd())
        {mundo.addObject(mundo.ka,getX(),getY());
         mundo.removeObject(this);
         return;
        }
    }    
}
danpost danpost

2017/11/14

#
What is mundo.ka'? where is the code that creates the 'mundo.ka' actor? what does that code look like? where is the variable 'ka' declared in your world class? what is the error message? What does the code to the 'play' method in your 'animator' class look like?
You need to login to post a reply.