I have 3 variables in my world Level1, but i don't know of a way to transfer it to my alternate worlds and save the variable. i would just like help on how to accomplish this so that i can have something like score and health transferred between worlds. thanks and i hope this helps...
public class Level1 extends World
{
public int score = 0;
public int Life = 4;
public int money = 0;
/**
* Constructor for objects of class Level1.
*
*/
public Level1()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(1000, 800, 1);
prepare();
}
public void act()
{
Spawn();
}
public void adjustScore(int amount)
{
score += amount;
showText("Score:" + score, 940, 40);
}
public void adjustMoney(int amount1)
{
money += amount1;
showText("Money:" + money, 940, 780);
}
public void adjustLife(int amount2)
{
Life += amount2;
}
i want to transfer these to my other world Level2