
const options = {
    completionURL: "../code_for_room/room_code.html" ,
    title: "Caves and Trees",
    background_image: "images/mountain_background.jpg",
    win_image: "", //OPTIONAl . use ""  if no win image.
    blank_image: "images/smalls/blank.png",
    dice_roll_sound: "sounds/diceroll.mp3",
    correct_answer_text: "CORRECT!",
    incorrect_answer_text: "WRONG!",
};

const characters = [
    {
        id: "girl",
        image: "images/angie_med.png",
        alt: "Image of a girl",
        piece_image: "images/smalls/blank_girl.png"
    },
    {
        id: "boy",
        image: "images/sam_med.png",
        alt: "Image of a boy",
        piece_image: "images/smalls/blank_boy.png"
    },
];

// In the following, the possible values for "action" are:
//    "roll" (roll dice again)
//    "move-up" (move one row up)
//    "move-back" (move one row back)
//    "problem-1" (get a problem)
//    "problem-2" (get more advanced problem)
const squares = [
    {
        id: "blank",
        // instruction_text: There is no instruction text for a blank square
        landing_text: "You have landed on nothing. Roll again!",
        image: "images/smalls/blank.png",
        alt: "Empty square",
        square_type: 0, // obstacle 0 (do nothing)
        action: "roll"
    },
    {
        id: "rock",
        instruction_text: "Answer a math question to continue.",
        landing_text: "You have tripped on a rock. Take a break and answer a math question to continue!",
        image: "images/smalls/rock2.png",
        alt: "rock",
        square_type: 1, // obstacle 1 (do a problem to proceed),
        action: "problem-1"
    },
    {
        id: "tree",
        instruction_text: "Your character advances to the next row.",
        landing_text: "You have landed on a tree. You get to climb up to the next row!",
        image: "images/smalls/tree.png",
        alt: "tree",
        square_type: 2, // ladder (go up one row)
        sound: "sounds/go_up.mp3",
        action: "move-up"
    },
    {
        id: "fire",
        instruction_text: "Answer a harder math question. If you get it right you will move double on the next roll.",
        landing_text: "You have landed on a campsite. Answer a harder math question to advance double on the next roll!",
        image: "images/smalls/fire.png",
        alt: "Image of a fire",
        square_type: 3, // obstacle 2 (do a harder problem to proceed)
        sound: "sounds/fire.mp3",
        action: "problem-2"
    },
    {
        id: "cave",
        instruction_text: "Your character gets sent back to the previous row.",
        landing_text: "You fell in a cave. Sorry, you fell back down to the previous row!",
        image: "images/smalls/hole.png",
        alt: "cave",
        square_type: 4, // hole (go down one row)
        sound: "sounds/falling.mp3",
        action: "move-back"
    },
];

// Square types
// 0: blank (nothing on this square)
// 1: obstacle 1 (do a problem to proceed)
// 2: ladder (go up one row)
// 3: obstacle 2 (do a harder problem to proceed)
// 4: cave (go down one row)

const map = [
    [0, 4, 2, 0, 3, 1, 0, 0, 1, 0, 0, 2, 1, 0, 1],
    [2, 0, 0, 1, 0, 0, 2, 0, 1, 0, 0, 1, 4, 0, 1],
    [0, 1, 0, 5, 2, 0, 0, 3, 0, 0, 0, 0, 1, 0, 0],
    [2, 0, 0, 4, 1, 0, 3, 4, 1, 2, 0, 1, 0, 0, 0],
    [0, 0, 1, 0, 3, 4, 0, 0, 2, 0, 0, 2, 1, 0, 0],
    [3, 1, 4, 0, 1, 0, 0, 3, 1, 0, 1, 0, 1, 0, 1],
    [0, 3, 0, 1, 3, 0, 0, 1, 2, 0, 0, 2, 0, 0, 0]
];
/*
    OPERATOR CAN BE / FOR DIVIDE , * FOR MULTIPLY, + FOR ADDITION OR - FOR SUBTRACTION
 */
const mathProblems = {
    easy: {operator:"*", minValue1:2, maxValue1: 20, minValue2:2, maxValue2:20},
    hard: {operator:"/", minValue1:16, maxValue1: 2500, minValue2:4, maxValue2:50},
}

export {options, characters, squares, map, mathProblems};