Commit 0991a0ca authored by Michael Weber's avatar Michael Weber
Browse files

Change position of touch buttons

parent 89ddebef
const images = [];
images.push(new ImageSound("left.png", "left.mp3", 15, 5));
images.push(new ImageSound("right.png", "right.mp3", 15, 25));
images.push(new ImageSound("forward.png", "forward.mp3", 5, 15));
images.push(new ImageSound("backwards.png", "backwards.mp3", 25, 15));
images.push(new ImageSound("left.png", "left.mp3", 150, 50));
images.push(new ImageSound("right.png", "right.mp3", 150, 250));
images.push(new ImageSound("forward.png", "forward.mp3", 50, 150));
images.push(new ImageSound("backwards.png", "backwards.mp3", 250, 150));
images.push(new ImageSound("stop.jpg", "stop.mp3", 5, 40));
images.push(new ImageSound("jump.png", "jump.mp3", 15, 40));
images.push(new ImageSound("lookaround.png", "look around.mp3", 25, 40, 5, 10));
images.push(new ImageSound("stop.jpg", "stop.mp3", 50, 400));
images.push(new ImageSound("jump.png", "jump.mp3", 150, 400));
images.push(new ImageSound("lookaround.png", "look around.mp3", 250, 400));
const touchScreen = document.getElementById("touchScreen");
images.forEach(image => {
......@@ -14,10 +14,10 @@ images.forEach(image => {
const DOM_img = document.createElement("img");
DOM_img.src = "images/" + image.image;
DOM_img.classList.add("screen__image");
DOM_img.style.top = image.top + "%";
DOM_img.style.left = image.left + "%";
DOM_img.style.width = image.width + "%";
DOM_img.style.height = image.height + "%";
DOM_img.style.top = image.top + "px";
DOM_img.style.left = image.left + "px";
DOM_img.style.width = image.width + "px";
DOM_img.style.height = image.height + "px";
DOM_img.dataset.sound = image.sound;
DOM_img.alt = image.sound;
......@@ -40,7 +40,7 @@ function playSound(sound) {
}
}
function ImageSound(image, sound, top, left, width = 5, height = 10) {
function ImageSound(image, sound, top, left, width = 50, height = 100) {
this.image = image;
this.sound = sound;
this.top = top;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment