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

2012/12/3

Adding a start screen?

bbwf bbwf

2012/12/3

#
Hey guys I want to add in a start screen for my game that details what you are going do before the game starts. I can't seem to figure out how I would code this tho. Please help me! Thanks.
danpost danpost

2012/12/3

#
If you already have an image saved for it, you can add an actor (call it 'Header') with that image in the world constructor and remove it either from the 'act' method or, even better, from the 'started' method.
if (!getObjects(Header.class).isEmpty()) removeObjects(getObjects(Header.class));
Even if you do not have a header image saved in a file, you can create the GreenfootImage to use as a header in the world constructor. As an alternative, you can start your scenario in a different world whose background is to be the header image; then you can change worlds when the scenario is started (in the 'act' or the 'started' method).
bbwf bbwf

2012/12/3

#
So the image would be my start screen but how would it go away?
danpost danpost

2012/12/4

#
If using an actor object, just 'removeObjects(getObjects(Header.class));' in a 'public void started' method. If using another world, 'Greenfoot.setWorld(new RealWorld());' either in a 'public void started' method or the 'act' method. (of course 'RealWorld' would be renamed to that of your real world.
TristinAubin TristinAubin

2012/12/5

#
dan can u help me step by step with a start screen and timer? email is tristinaubin@live.horrycountyschools.net
You need to login to post a reply.