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

2015/12/14

Objects

ironphoenix20 ironphoenix20

2015/12/14

#
Is there a way for me to code so that the actors and objects I want are already in my world so I don't need to right click, new object, and drag it into the world every single time?
Sam17 Sam17

2015/12/14

#
You can right click on the actual world of your scenario and click on the 'save world' option. This will save the current state of your world and use the constructor of the world to create the objects.
danpost danpost

2015/12/14

#
The best way to learn how to do this is to (1) right click and add them in to the world manually (2) use the 'Save the World' feature (use the menubar, under 'Controls' (3) open you World subclass editor (4) reverse engineer the added code (the 'prepare' method'). What this 'Save the World' feature does is it takes all actions you do between the last reset and the time you use it and writes the code for you (once an act cycle is executed, it will no longer work). You should be familiar with the methods used in the created code -- refer to the World class API documentation.
fejfo fejfo

2015/12/14

#
what danpost means with 4 is use "addObject(" in the world
danpost danpost

2015/12/14

#
fejfo wrote...
what danpost means with 4 is use "addObject(" in the world
Actually, what I meant was to look over the code, compare it to what actions you had taken before saving the world and learn from that comparison.
You need to login to post a reply.