A new version of this scenario was uploaded on Thu Jun 16 10:47:57 UTC 2011
The demo now shows how to move actors between worlds.
The previous version created a new Pengu actor in each world.
I have now modified this so that the SAME Pengu actor object moves from one world to the other. This may be important if you want to keep some state (such as a score) in the actor without losing it when moving to other levels.
A new version of this scenario was uploaded on Thu Jun 16 10:49:35 UTC 2011
Oops - added source again.
there's 1 thing pissed me out about greenfoot , is that , like in this game, when pengu jumps from the cloud , and hits the middle of the ground(the soil beneath grass ), it should fall, rather it stays and if we press "jump " it goes to surface,, can anyone tell me, how to fix this?? or how to make an image like a solid object ?
@bijoy508 Are you asking why the penguin can move into the side of the cliffs and jump through the ground? I'd imagine making those 'cliffs' or sides of some object to act as a wall to your character or such.
I'm having an issue when switching between worlds, where I have two worlds, and a common actor in between. Eventually when switching between the two worlds, I inevitably come across a Java out of memory error. I'm wondering if there's some sort of issue deleting the resources of each world in the setWorld method.
Hi,
Thanks for the scenario. It was very helpful. I was wondering if sombody could give me some tips. Where does Greenfoot decides which world to start with. If I duplicate the first world, which I have created in the scenario (under a different name), Greenfoot still starts with the original world. How do I control with which world to start (without too complex coding).
Richard
Jinno - post something in the discussion forum, ideally with a link to your scenario which demonstrates the problem.
Richard - whichever world you interactively instantiated (right click world class, "new XyzWorld()") is the one that Greenfoot remembers as the default world. (for more help, post in the discussion forum).
Hi davmac,
thank for the reply. Sorry, I might missunderstand you. I created three worlds. The default one is the one I created first. How can I convince Greenfoot to start with the second or third world I created. In the example scenario on this page. How could we get Greenfoot to start with Level 2?
Richard,
As per my comment, to set the default world class:
... right click world class, "new XyzWorld()" ...
I.e. first right-click on the world class (in the class tree) and then click "new XyzWorld()" (where "XyzWorld" is an example and will change depending on the class name). And please:
(for more help, post in the discussion forum).
How does it know its going to start from level1 ??
I mean where is the code that tell the world to start the game from the first level ???
Please let me know :)
thanks
While you are developing, you can instantiate different levels interactively (by right-clicking your world subclass and selecting "new ...").
The world which you last instantiated interactively will be the one the scenario starts with.
Glad someone answered.
I was trying to make another super class for my levels (subWorlds), since they all share stuff like background, but i faced some issue since they are all children of that class. I didn't know how to call them, so i make it simple, they are all subclasses of World.
guess will try now to see how it works.
I implemented this as a cheat to send the player into a blank room in my game, and it was working. However I was changing the layout of the room a bit and now the scenario freezes every time I use the cheat. I've tried changing the layout back to how it was before along with a multitude of other things, but it just won't work anymore. Does anyone know why?
2011/6/9
2011/6/19
2011/6/20
2011/6/26
2011/6/26
2011/6/26
2011/7/12
2011/8/5
2011/8/5
2011/8/8
2011/8/8
2011/8/8
2011/11/19
2011/11/19
2011/11/19
2012/10/24
2013/3/18
2013/6/10
2013/6/10
2013/6/15
2017/9/6
2020/4/9
2024/7/26