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

2014/9/14

Level Variable

DarkSoulDemon DarkSoulDemon

2014/9/14

#
Is there a way of making a Level variable. I would be very greatfull if someone helped thank you.
danpost danpost

2014/9/14

#
Usually, an instance int field is used in the game world.
DarkSoulDemon DarkSoulDemon

2014/9/14

#
How would I code that.
danpost danpost

2014/9/14

#
Usually with this:
public static int level;
with this in the initial constructor:
level = 1;
If a new instance of this class could be set later, you will probably need another constructor with a parameter to distinguish a remake of the world as compared to the initial world.
DarkSoulDemon DarkSoulDemon

2014/9/14

#
so where would i put that would it be within the counter or world or would it be a class on its own. Sorry i am relatively new to java.
danpost danpost

2014/9/14

#
danpost wrote...
Usually, an instance int field is used in the game world.
I had said this previously. I crossed off 'instance' because I suggested it be a class field (static) afterwards.
DarkSoulDemon DarkSoulDemon

2014/9/14

#
danpost you are a LEGEND THANK YOU
You need to login to post a reply.