diff --git a/Bug Eliminator/app.html b/Bug Eliminator/app.html new file mode 100644 index 00000000..3f24fa80 --- /dev/null +++ b/Bug Eliminator/app.html @@ -0,0 +1,35 @@ + + + + + + + + + + + +
+
+ + + + +
+ +
Start:
+ +
+ + + + + + \ No newline at end of file diff --git a/Bug Eliminator/estilo.css b/Bug Eliminator/estilo.css new file mode 100644 index 00000000..df718d5e --- /dev/null +++ b/Bug Eliminator/estilo.css @@ -0,0 +1,64 @@ +@charset "UTF-8"; + + +html { + cursor: url(img/mata_mosquito.png) 30 30, auto; +} + +body { + background-image: url(img/bg.jpg); + background-repeat: no-repeat; +} + + + + +.mosquito1 { + width: 50px; + height: 50px; +} + +.mosquito2 { + width: 70px; + height: 70px; +} + +.mosquito3 { + width: 90px; + height: 90px; +} + + + + +.ladoA { + transform: scaleX(1); +} + +.ladoB { + transform: scaleX(-1); +} + + + + +.painel { + position: absolute; + width: 190px; + padding: 10px; + left: 0px; + bottom: 0px; + border-top: solid 1px white; + background-color: white; + opacity: 0.7; +} + +.vidas { + float: left; +} + +.cronometro { + float: left; + font-size: 20px; + font-weight: bold; +} \ No newline at end of file diff --git a/Bug Eliminator/fim_de_jogo.html b/Bug Eliminator/fim_de_jogo.html new file mode 100644 index 00000000..ee31a3ff --- /dev/null +++ b/Bug Eliminator/fim_de_jogo.html @@ -0,0 +1,35 @@ + + + + + + + + + + + Document + + + +
+
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/Bug Eliminator/icon.png b/Bug Eliminator/icon.png new file mode 100644 index 00000000..75b0dc81 Binary files /dev/null and b/Bug Eliminator/icon.png differ diff --git a/Bug Eliminator/img/bg.jpg b/Bug Eliminator/img/bg.jpg new file mode 100644 index 00000000..927ab2f0 Binary files /dev/null and b/Bug Eliminator/img/bg.jpg differ diff --git a/Bug Eliminator/img/coracao_cheio.png b/Bug Eliminator/img/coracao_cheio.png new file mode 100644 index 00000000..b9c7f1d1 Binary files /dev/null and b/Bug Eliminator/img/coracao_cheio.png differ diff --git a/Bug Eliminator/img/coracao_vazio.png b/Bug Eliminator/img/coracao_vazio.png new file mode 100644 index 00000000..b4226501 Binary files /dev/null and b/Bug Eliminator/img/coracao_vazio.png differ diff --git a/Bug Eliminator/img/game_over.png b/Bug Eliminator/img/game_over.png new file mode 100644 index 00000000..d948a530 Binary files /dev/null and b/Bug Eliminator/img/game_over.png differ diff --git a/Bug Eliminator/img/mata_mosquito.png b/Bug Eliminator/img/mata_mosquito.png new file mode 100644 index 00000000..58c54b97 Binary files /dev/null and b/Bug Eliminator/img/mata_mosquito.png differ diff --git a/Bug Eliminator/img/mosca.png b/Bug Eliminator/img/mosca.png new file mode 100644 index 00000000..6b34b454 Binary files /dev/null and b/Bug Eliminator/img/mosca.png differ diff --git a/Bug Eliminator/index.html b/Bug Eliminator/index.html new file mode 100644 index 00000000..73f3863e --- /dev/null +++ b/Bug Eliminator/index.html @@ -0,0 +1,64 @@ + + + + + + Document + + + + + + + + + + +
+
+
+
+ +
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+
+
+ + + + diff --git a/Bug Eliminator/jogo.js b/Bug Eliminator/jogo.js new file mode 100644 index 00000000..614ef558 --- /dev/null +++ b/Bug Eliminator/jogo.js @@ -0,0 +1,126 @@ +let largura = 0 +let altura = 0 +let vidas = 1 +let tempo = 30 + +let criaMosquitoTempo = 2000 + +let nivel = window.location.search +nivel = nivel.replace('?', '') + +if (nivel === 'normal') { + + + criaMosquitoTempo = 2000 + +} else if (nivel === 'dificil') { + + + criaMosquitoTempo = 1500 + +} else if (nivel === 'extremo') { + + + criaMosquitoTempo = 1000 + +} else if (nivel === 'insano') { + + + criaMosquitoTempo = 750 + +} + +function ajustaTamanhoPalcoJogo() { + altura = window.innerHeight + largura = window.innerWidth + + console.log(largura, altura) +} + +ajustaTamanhoPalcoJogo() + +let cronometro = setInterval(function() { + + tempo -= 1 + + if (tempo < 0) { + clearInterval(cronometro) + clearInterval(criaMosquito) + window.location.href = 'vitoria.html' + } else { + document.getElementById('cronometro').innerHTML = tempo + } + +}, 1000) + +function posicaoRandomica() { + + + if (document.getElementById('mosquito')) { + document.getElementById('mosquito').remove() + + + if (vidas > 3) { + + window.location.href = 'fim_de_jogo.html' + } else { + document.getElementById('v' + vidas).src = "img/coracao_vazio.png" + + vidas++ + + } + } + + + let posicaoX = Math.floor(Math.random() * largura) - 90 + let posicaoY = Math.floor(Math.random() * altura) - 90 + + + posicaoX = posicaoX < 0 ? 0 : posicaoX + posicaoY = posicaoY < 0 ? 0 : posicaoY + + console.log(posicaoX, posicaoY) + + let mosquito = document.createElement('img') + mosquito.src = 'img/mosca.png' + mosquito.className = tamanhoAleatorio() + ' ' + ladoAleatorio() //Espaço em branco na concatenação para não haver problema na chamada. + mosquito.style.left = posicaoX + 'px' + mosquito.style.top = posicaoY + 'px' + mosquito.style.position = 'absolute' + mosquito.id = 'mosquito' + mosquito.onclick = function() { + this.remove() + } + + document.body.appendChild(mosquito) + +} + + +function tamanhoAleatorio() { + let classe = Math.floor(Math.random() * 3) + + switch (classe) { + case 0: + return 'mosquito1' + + case 1: + return 'mosquito2' + + case 2: + return 'mosquito3' + } +} + +function ladoAleatorio() { + let classe = Math.floor(Math.random() * 3) + + switch (classe) { + case 0: + return 'ladoA' + + case 1: + return 'ladoB' + + } +} \ No newline at end of file diff --git a/Bug Eliminator/manifest.json b/Bug Eliminator/manifest.json new file mode 100644 index 00000000..170c1a6d --- /dev/null +++ b/Bug Eliminator/manifest.json @@ -0,0 +1,30 @@ +{ + "manifest_version": 3, + "name": "Bug Eliminator", + "version": "1.0", + "description": "Bug Eliminator", + "icons": { + "48": "icon.png", + "64": "icon.png", + "128": "icon.png" + }, + "permissions": [ + "storage" + ], + "optional-permissions": [ + "tabs" + ], + "action": { + "default_popup": "index.html" + }, + "web_accessible_resources": [ + { + "resources": [ + "index.html" + ], + "matches": [ + "" + ] + } + ] +} \ No newline at end of file diff --git a/Bug Eliminator/vitoria.html b/Bug Eliminator/vitoria.html new file mode 100644 index 00000000..461c59a1 --- /dev/null +++ b/Bug Eliminator/vitoria.html @@ -0,0 +1,35 @@ + + + + + + + + + + + Document + + + +
+
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+ + + + \ No newline at end of file