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

2011/12/22

new level

heeiny heeiny

2011/12/22

#
how can i make a new level in a game?? please help me:):):):)
marzukr marzukr

2011/12/30

#
If you want help on how to switch a world then here you go:
if (Greenfoot.mouseClicked(this)) //this command could be anything, whatever you want to be checked. 
{  
    Greenfoot.setWorld(world);  // the 'world' in the '()' is a reference to whatever world you have in your senario and want to switch to.  
}  
danpost danpost

2011/12/30

#
It really depends on what changes there will be between the previous level and the new level. If increased speed or more obstacles are used for increase level numbers, just removing all objects and re-populating with more is all that is needed (and in some cases, that may not even be neccessary). If the whole scenario changes to something that is not even close to similar to the previous level, and new world object might be the way to go. Without any specifics on what you mean by changing levels, it is hard to be of much help, other than generally.
heeiny heeiny

2012/1/2

#
to marzukr why he answerd "cannot find symbol - variable level2"
marzukr marzukr

2012/1/6

#
Sorry it is if (Greenfoot.mouseClicked(this)) //this command could be anything, whatever you want to be checked. { Greenfoot.setWorld(new world); // the 'world' in the '()' is a reference to whatever world you have in your senario and want to switch to. }
TopInPut TopInPut

2012/1/7

#
We say, if your Player comes on a Coin, he will come into Level 2.;) Then it would look like this: if(playerOnCoin()) { Greenfoot.setWord(new Level2()); } ^^
TopInPut TopInPut

2012/1/7

#
Here an example of my project.;) It's really the same.^^
if(Greenfoot.mouseClicked(this)) {
            Greenfoot.setWorld(new Floor1());
        }
EpicAlbino EpicAlbino

2012/7/6

#
java.lang.IllegalStateException: Actor not in world. An attempt was made to use the actor's location while it is not in the world. Either it has not yet been inserted, or it has been removed. at greenfoot.Actor.failIfNotInWorld(Actor.java:663) at greenfoot.Actor.getX(Actor.java:157) at Character.atWorldEdge(Character.java:21) at Person.<init>(Person.java:18) WTF as in Western Tamale Flies but really what the fuck.
nccb nccb

2012/7/6

#
Line 18 in your Person class, which is run during construction of the Person, is asking if the Person is at the edge of the world. Construction of the Person must finish before the object can be added, so if you ask anything about your position in the world during construction, it's too early: you can't be in the world, so you will get an exception. Avoid examining your position during construction.
EpicAlbino EpicAlbino

2012/7/6

#
Thanks a ton. I just Fixed the issue.
You need to login to post a reply.