I got this game in HTML + JavaScript + CSS a while ago, I'd like to implement a time in the upper corner of the screen (either side) bugging every game!
Here is the function of Start
in the game, I think of implementing the difficulty after being able to add this time on the screen:
function newGame() {
block = 0
angle = 2
tempX = 0
tempY = 0
square = 0
squareTop = 0
squareLeft = 0
squareMotion = 1
nextScore = 0
score = 0
count = 0
collisionOne = 0
collisionTwo = 0
collisionThree = 0
clearTimeout(timeoutOne)
clearInterval(intervalOne)
clearInterval(intervalTwo)
document.getElementById("square0").style.left = "0px"
document.getElementById("square0").style.top = "0px"
document.getElementById("square0").style.display = "block"
document.getElementById("square1").style.left = "0px"
document.getElementById("square1").style.top = "0px"
document.getElementById("square1").style.display = "block"
document.getElementById("pad").style.top = (gameHeight - 40) + "px"
document.getElementById("pad").innerHTML = ""
document.getElementById("notepad").innerHTML = ""
intervalOne = setInterval("playGame()", speed)
}
Follow the game running:
The initial idea is to implement a time that starts when you click Play! Still have a few bugs ... little experience yet rsrsrs!