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

2017/5/17

HELP!

GewoonAxl GewoonAxl

2017/5/17

#
I want when I press "PLAY" that it goes from my menu to the game itself can someone help me?
Yehuda Yehuda

2017/5/17

#
What is your menu? If it's just an actor that's added into the world in the constructor then you can remove it with the started method.
Actor menuActor = new Actor() {
};

public MyWorld() {
    menuActor.setImage("filename.png");
    addObject(menuActor, getWidth() / 2, getHeight() / 2) // here an actor is added
}

@Override
public void act() {
}

@Override
public void started() {
    removeObject(menuActor); // here it's removed when "Run' is pressed
}
I think I may have misunderstood you. If you mean that you want to remove an actor when your "Play" button is pressed, then you will have to elaborate a little more on what's happening. (Just put getWorld().removeObject(this); in the place that the "Play" button gets pressed.)
You need to login to post a reply.