Here's the thing, guys, I'm just starting to learn javascript, I mean, I've learnt the basics, but nothing too deep, and I want to make a small game just to train my skills. here is the javascript code for it:
P.S. start must equal true to start it, just change the value, actually I wanted to make a button so I could start it, but I don't know how to do it just yet. My problem here is: it works just to a certain point, after that it doesn't run anymore, I can't see why. Can someone help me?
Another problem, I was using console.log to print what I wanted, but I realized it doesn't work so I changed it all to prompt, don't know if there's something better. btw, there's a lot to work, that's just the beginning, but I want to understand why it is not working.
Code:
var start=false;
var char1;
function char(name,classe,gender,str,vit,int,skill1,skill2,skill3,skill4,skill5){
    this.name=name;
    this.level=1;
    this.classe=classe;
    this.gender=gender;
    this.str=str;
    this.vit=vit;
    this.int=vit;
    this.hp=hp;
    hp=vit*10;
    this.skill1=skill1;
    skill1.name=null;
    this.skill2=skill2;
    skill2.name=null;
    this.skill3=skill3;
    skill3.name=null;
    this.skill4=skill4;
    skill4.name=null;
    this.skill5=skill5;
    skill5.name=null;
}
function charinv(weapon,shirt,legs,dress,helmet,shoes){
    this.weapon=weapon;
    this.shirt=shirt;
    this.dress=dress;
    this.legs=legs;
    this.helmet=helmet;
    this.shoes=shoes;
}
function charbag(gold,itemslot1,itemslot2,itemslot3,itemslot4,itemslot5,itemslot6,itemslot7,itemslot8){
    this.gold=gold;
    this.itemslot1=itemslot1;
    this.itemslot2=itemslot2;
    this.itemslot3=itemslot3;
    this.itemslot4=itemslot4;
    this.itemslot5=itemslot5;
    this.itemslot6=itemslot6;
    this.itemslot7=itemslot7;
    this.itemslot8=itemslot8;
    
}
function mob(name,level,str,vit,int,gold,item,mobskill1,mobskill2,mobskill3){
    this.name=name;
    this.level=level;
    this.str=str;
    this.vit=vit;
    this.int=int;
    this.gold=gold;
    this.golddrop=gold*Math.random();
    this.item=item;
    this.itemdrop=item*Math.random();
    this.hp=hp;
    hp=vit*10;
    this.mobskill1=mobskill1;
    mobskill1.name=null;
    this.mobskill2=mobskill2;
    mobskill2.name=null;
    this.mobskill3=mobskill3;
    mobskill3.name=null;
}
function item(id,name,lvlreq,str,vit,int){
    this.id=id;
    this.name=name;
    this.lvlreq=lvlreq;
    this.str=str;
    this.vit=vit;
    this.int=int;
}
function fight(mobfunction){
    var answerfight=prompt("Would you like to fight "+mobfunction.name+"?Type yes or no.").toUpperCase;
    for(;answerfight!="YES"&&answerfight!="NO";){
        console.log("Invalid answer.");
        answerfight=prompt("Would you like to fight "+mobfunction.name+"?Type yes or no").toUpperCase;
    var escapeanswer=false;
    if(answerfight=="NO"){
        var escapechance=char1.level-mobfunction.level+2*Math.random()*100;
        if(escapechance>=100){
            escapeanswer=true;
        }
        }
        if(escapeanswer){
            console.log("You ran from the monster.");
        }else{
            if(answerfight=="NO"){
                console.log("You couldn't run from the monster.");
            }
            for(;mobfunction.hp<=0||char1.hp<=0;){
                console.log("It's your turn.");
                var charturn=prompt("What would you like to do?Use "+char1[skill1].name+", "+char1[skill2].name+", "+char1[skill3].name+", "+char1[skill4].name+", "+char1[skill5].name+" or hit?");
                switch(charturn){
                    case 'char1.skill1':
                        break;
                    case 'char1.skill2':
                        break;
                    case 'char1.skill3':
                        break;
                    case 'char1.skill4':
                        break;
                    case 'char1.skill5':
                        break;
                    case 'hit':
                        break;
                }
                if(charturn!=char1[skill1].name&&charturn!=char1[skill2].name&&charturn!=char1[skill3].name&&charturn!=char1[skill4].name&&charturn!=char1[skill5].name&&charturn!="hit"){
                    
                }
            }
        }
    }
}
if(start){
      //insert story here...
var charname=prompt("What is your character's name?");
var answer1=prompt("There are 3 main classes: Warrior, Archer and Mage.");
prompt("Please type the name of the class you want.").toUpperCase();
for(; charclasse!="WARRIOR"&&charclasse!="ARCHER"&&charclasses!="MAGE";){
    prompt("Invalid class.");
charclasse=prompt("Please type the name of the class you want.").toUpperCase();
}
var charstr;
var charvit;
var charint;
switch(charclasse){
    case 'WARRIOR':
        charstr=8;
        charvit=10;
        charint=3;
        break;
    case 'ARCHER':
        charstr=10;
        charvit=6;
        charint=5;
        break;
    case 'MAGE':
        charstr=5;
        charvit=6;
        charint=10;
        break;
}
var chargender=prompt("Are you male or female?").toUpperCase();
for(; chargender!="MALE"&&chargender!="FEMALE";){
    console.log("Invalid gender.");
    chargender=prompt("Are you male or female?").toUpperCase();
}
char1=new char(charname,charclasse,chargender,charstr,charvit,charint);
//insert more story here...
prompt("Okay, now let`s decide the features of your character");
var chardress;
var charshirt;
var charlegs;
var charshoes;
var charhair;
if(char1.gender=="FEMALE"){
    //female char
    //show the char with the 3 possible hairs
    charhair=prompt("Do you want your hair to be:black,blonde or red?").toUpperCase();
for(;hair!="BLACK"&&hair!="BLONDE"&&hair!="RED";){
    console.log("Invalid hair color.");
    hair=prompt("Do you want your hair to be:black,blonde or red?").toUpperCase();
    //show the char with the 3 possible dresses
    chardress=prompt("Choose one of the dresses and type 1,2 or 3.");
    for(;chardress!=1&&chardress!=2&&chardress!=3;){
        console.log("Invalid choice.");
            chardress=prompt("Choose one of the dresses and type 1,2 or 3.");
    }
    //show the char with 3 possible shoes
    charshoes=prompt("Choose one of the three shoes and type 1,2 or 3");
    for(;charshoes!=1&&charshoes!=2&&charshoes!=3;){
        console.log("Invalid choice.");
        charshoes=prompt("Choose one of the three shoes and type 1,2 or 3");
    }
}
}else{
        //show the char with the 3 possible hairs
    charhair=prompt("Do you want your hair to be:black,blonde or red?").toUpperCase();
for(;hair!="BLACK"&&hair!="BLONDE"&&hair!="RED";){
    console.log("Invalid hair color.");
    hair=prompt("Do you want your hair to be:black,blonde or red?").toUpperCase();
}
    //show the char with 3 possible shirts
    charshirt=prompt("Choose one of the shirts and type 1,2 or 3");
    for(;charshirt!=1&&charshirt!=2&&charshirt!=3;){
        console.log("Invalid choice.");
        charshirt=prompt("Choose one of the shirts and type 1,2 or 3");
    }
    //show the char with 3 possible leggings
    charlegs=prompt("Choose one of the leggings and type 1,2 or 3");
    for(;charlegs!=1&&charlegs!=2&&charlegs!=3;){
        console.log("Invalid choice.");
        charlegs=prompt("Choose one of the leggings and type 1,2 or 3");
    }
    charshoes=prompt("Choose one of the three shoes and type 1,2 or 3");
    for(;charshoes!=1&&charshoes!=2&&charshoes!=3;){
        console.log("Invalid choice.");
        charshoes=prompt("Choose one of the three shoes and type 1,2 or 3");
    }
    chardress=char1.chardress;
    charshirt=char1.charshirt;
    charlegs=char1.charlegs;
    charhair=char1.charhair;
    charshoes=char1.charshoes;
    //tell some story here...
    //show the map
    var question1=prompt("What do you want to do next? Go north, go south, go east, go west or talk to that guy?");
    for(;question1!="go south"&&question1!="go north"&&question1!="go east"&&question1!="go west"&&question1!="talk to that guy";){
        console.log("Invalid choice.");
        question1=prompt("What do you want to do next? Go north, go south, go east, go west or talk to that guy?");
    }
        switch(question1){
        case 'go north':
            break;
        case 'go south':
            break;
        case 'go east':
            break;
        case 'go west':
            break;
        case 'talk to that guy':
            break;
    }
}
}