The Colours Of Treason (you wont be able to do anything but later u will)

Arthur

Another boring day to make sure the king is not getting food poisening

Jhon

I am sooo tired right now

Arthur

Welp lets start or else the king will shout at us

Jhon

Why did we want to do this?

// IMPORTANT: Change this variable to the total number of screens in your game!!! const NUMBER_OF_SCREENS = 4; // This variable represents the current screen. let currentscreen = 1; // This variable is pointing to the screen element so that it can be referenced later. let screen = document.getElementById("screen"); // These two variables are pointing to the 'B' and 'A' buttons so we can tell when they're clicked. let B = document.getElementById("B"); let A = document.getElementById("A"); // This is a function that updates the screen based on the 'currentscreen' variable. function updatescreen() { // First, the screen is cleared of its content. screen.innerHTML = ""; // Then, screen content is copied from the document, based on the id of the span. screen.appendChild(document.getElementById(currentscreen).cloneNode(true)); } // This is the code that runs when the 'B' button is clicked. B.onclick = function() { // First we make sure we're not going behind the first screen. if (currentscreen - 1 >= 1){ // Then the 'currentscreen' is changed, and the screen is updated. currentscreen -= 1; updatescreen(); } }; // This is the code that runs when the 'A' button is clicked A.onclick = function() { // First we make sure we're not going beyond the last screen. if (currentscreen + 1 <= NUMBER_OF_SCREENS){ // Then the 'currentscreen' is changed, and the screen is updated. currentscreen += 1; updatescreen(); } }; // This updates the screen for the very first time, so we will see the first screen at the start. updatescreen();