c = new Console ();
int lvl = 1;
double exp = 0;
int x = 1;
double monsterhp;
int monslvl = 1;
int a = 1;
while (a == 1)
{
int lvlup = 10 + (lvl * 40);
if (exp >= lvlup)
{
lvl = lvl + 1;
exp = 0;
}
double maxhp = 50 + (lvl * 5);
double maxmp = 5 + (lvl);
double hp = maxhp;
double mp = maxmp;
hp = Math.rint (hp);
double hpbar;
double mpbar;
a = 0;
double monsgen = Math.random () * 10;
monsgen = Math.round (monsgen);
String battle = ("battle");
hpbar = maxhp / hp * 100;
mpbar = maxmp / mp * 100;
if (monsgen < 6)
{
monsterhp = 90 + (lvl * 10);
while (battle.equals ("battle"))
{
c.clear ();
c.setColor (Color.red);
c.fillRect (2, 0, hpbar, 2);
c.setColor (Color.blue);
c.fillRect (5, 0, mpbar, 2);
c.println ("Lvl: " + lvl);
c.setColor (Color.green);
c.fillRect (0, 5, )
c.print ("Your hp: ");
c.setTextColor (Color.red);
c.print (hp);
c.setTextColor (Color.black);
c.print (" Monster hp: ");
The misplaced construct problem occured at the red line. The string is defined and it should run the loop. Any help is appreciated. thanks