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

2014/9/2

Saving Actor Positions Help!

pokemunn pokemunn

2014/9/2

#
Hi there, I might just be really blind to an already existing feature but how would I make it so that when I compile my scenario I don't have to keep replacing the actors in their positions, so they automatically 'spawn' where I want them. Thanks in advance.
GreenGoo GreenGoo

2014/9/2

#
In your World constructor, write:
addObject(new myObject(), x, y);
myObject is whatever Object you are trying to add, and then you can choose the x and y co-ordinates.
danpost danpost

2014/9/2

#
There is a 'Save the World' feature (by way of the menubar using 'Controls>Save the World') that you can use after placing the objects in your world to put the code in your world class. I would not suggest you use it more than a couple of times -- just to get used to what code it produces; then, start putting the code in yourself.
pokemunn pokemunn

2014/9/2

#
Thanks guys, I'll have a crack at that.
You need to login to post a reply.