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

2018/1/16

Keep actors

Chepaci Chepaci

2018/1/16

#
Hello guys, i have a project, to do, with chemistry so i took an icon(actor) of start, i put a world background,so i maded the click, when i press click on start it goes me to the world (brick) but everytime when i want to start, i need to put the start icon like new start, to the game, how can the game keep it all the times?
xbLank xbLank

2018/1/16

#
Use the constructor.
public class MyWorld extends World
{
	public MyWorld()
	{
		Start icon = new Start();
		addObject(icon,300,400);
	}
}
The code above creates the Actor "Start" at the location x = 300, y = 400 whenever the world is loaded. Another way of doing it would be right clicking in your world and selecting "Save World" once you added all actors. It basically does the same thing. It just does it for you. How kind of Greenfoot, isnt it?
Chepaci Chepaci

2018/1/16

#
thanks i appreaciated
Chepaci Chepaci

2018/1/17

#
yea but it only does it for the first world, i want for the two one too.
Chepaci Chepaci

2018/1/17

#
oh, i don't know what i did, but it keeps everything thx bro.
You need to login to post a reply.