js/script.js
//Function gerelateerd met de hunger bar//
Function gerelateerd met de hunger bar
Function gerelateerd met de hunger bar
function pandaeating() {
    hungerPoints = hungerPoints + 1
    if (hungerPoints > 10) {
        hungerPoints = hungerBarsImg.length - 1
        pandarefusingfood();
    } else {
        pandaImg.src = './pictures/panda/panda_eating.png';
        if (redtshirtOn == true) {
            pandaImg.src = './pictures/panda/panda_red_tshirt_eating.png'
        }
        setTimeout(pandathankingfood, 1800)
        bambooImg.classList.add('disappear')
        setTimeout(showbamboo, 1800)
        eatingAudio.currentTime = 0;
        eatingAudio.play();
    }
    hungerBar.src = './pictures/website_objects/hunger_bar/' + hungerBarsImg[hungerPoints]
    if (hungerbarInterval == null) {
        hungerbarInterval = setInterval(() => {
            pandagettinghungry();
        }, 15000);
    }
}
function pandaeating ( ) { hungerPoints = hungerPoints + 1 if ( hungerPoints > 10 ) { hungerPoints = hungerBarsImg . length - 1 pandarefusingfood ( ) ; } else { pandaImg . src = './pictures/panda/panda_eating.png' ; if ( redtshirtOn == true ) { pandaImg . src = './pictures/panda/panda_red_tshirt_eating.png' } setTimeout ( pandathankingfood , 1800 ) bambooImg . classList . add ( 'disappear' ) setTimeout ( showbamboo , 1800 ) eatingAudio . currentTime = 0 ; eatingAudio . play ( ) ; } hungerBar . src = './pictures/website_objects/hunger_bar/' + hungerBarsImg [ hungerPoints ] if ( hungerbarInterval == null ) { hungerbarInterval = setInterval ( ( ) => { pandagettinghungry ( ) ; } , 15000 ) ; } }
Function gerelateerd met de hunger bar
Function gerelateerd met de hunger bar