1
I have no idea why my buttons are not working
javakid999 (2)

so, I have made a lot of progress since you guys helped me out last time, but I am sadly stuck again. I have added a pause feature, and I want to make it so that you are not able to click any of the buttons when you are paused. Me and my friend have been trying for about 2 days to fix this issue, and we have no idea why it isn't working, so it would me amazing if someone out there could help me out! https://colonize-mars-alpha-135--javakid999.repl.co/

You are viewing a single comment. View All
1
Vandesm14 (482)

Add an absolute page cover:
HTML

<div id="pageCover"></div>

CSS

#pageCover {
	position: absolute;
	z-index: 1;
	width: 100vh;
	height: 100vh;
	padding: 0;
	margin: 0;
	top: 0;
	left: 0;
}

Just toggle the display property of the page cover:

function showHideCover() {
	var x = document.getElementById("pageCover");
	if (x.style.display === "none") {
		x.style.display = "block";
	} else {
		x.style.display = "none";
	}
}

Please mark this as answered if I helped your problem 👍

1
javakid999 (2)

@Vandesm14 hmm... This makes sense, and I put all of the code into the game, but it still appears to be doing nothing, and there are no error messages popping up.

1
Vandesm14 (482)

@javakid999 Is there a pause button?