let pikachuName = "Pikachu" let pikachu = { name: "Pikachu", health: 45, image: "Images/pikachu.png", level: 8, }; let bulbasaur = { name: "Bulbasaur", health: 70, image: "Images/bulbasaur.png", level: 12, }; let oranguru = { name: "Oranguru", health: 170, image: "Images/oranguru.png", level: 45, }; let drowzee = { name: "Drowzee", health: 90, image: "Images/drowzee.png", level: 33, }; let possiblePokemon = [pikachu, bulbasaur, oranguru, drowzee]; let randomPokemon = null; let playerName = "Bjarne"; let playerImage = "/Images/pokemonTrainerIdle.png"; let playerPokemon = []; let app = document.getElementById("app"); updateView(); function updateView() { getRandomPokemon() app.innerHTML = /*HTML*/ `
${randomPokemon.name}
lvl: ${randomPokemon.level}
${playerName}
`; } function caughtPokemonView(){ app.innerHTML = /*HTML*/`

Du fanget ${playerPokemon[playerPokemon.length - 1].name}

`; } function catchPokemon(){ playerPokemon.push(randomPokemon); caughtPokemonView(); } function showPokemon(){ console.log(playerPokemon); } function getRandomPokemon(){ let randomNum = Math.floor(Math.random() * possiblePokemon.length); randomPokemon = possiblePokemon[randomNum]; }