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

2018/4/20

Saving the current world as another new world

ZMakschZ ZMakschZ

2018/4/20

#
Hello everyone, in my first ever Greenfoot project, resembling New Super Mario Bros, I try to implement a level-editor. I want to be able to add objects in the level-editor-world and then save the "edited" world as a new world called differently by the press of a button. I already have the button part but can't figure out a way to save to another world. Thanks for your help!
danpost danpost

2018/4/20

#
I think you need to elaborate on exactly what you are trying to do. The big thing that is throwing me off is "save to another world". My guess is you are saving the edited world ... but to what world? is it not already in the level-editor world? and where is the button, in the editor-world or somewhere else? maybe it is in some menu-world of which you do not mention. Is that where you want to save the edited world to?
ZMakschZ ZMakschZ

2018/4/20

#
With saving to another world I mean saving the world with the current objects to a world with a different name, I don't mind if the world I'm saving too already exists or not, I just need a way to save to another world because I want to be able to design my own levels, save them and then be able to design a new level. The save-button is in the editor world. Summing it all up, I want to design a level in the level-editor, save that level to a world, so that I can open it anytime later, and still have the abbility to make another level which will be saved in a differently world. I hope that helped.
danpost danpost

2018/4/20

#
Are you wanting to be able to close the project and re-open it later with the edited worlds accessible? or just retain them during the current running of the project?
ZMakschZ ZMakschZ

2018/4/21

#
It would be nice if the levels could be reopened after a restart, just like you would in a normal game.
danpost danpost

2018/4/21

#
ZMakschZ wrote...
It would be nice if the levels could be reopened after a restart, just like you would in a normal game.
To do that, your world set-up will need to be stored in a file or database.
ZMakschZ ZMakschZ

2018/4/26

#
And how do I do that?
danpost danpost

2018/4/26

#
ZMakschZ wrote...
And how do I do that?
That is asking a bit much -- don't you think? Try something first. Then, if you run into problems, you can show what you tried and ask for help in fixing you code. I doubt you would be able to get anyone to write the code for you (especially since one would need to know everything about your scenario and what would be important to save).
You need to login to post a reply.