My first shoot collides with any enemie for some milliseconds staying stopped, and then, the shoot keeps going. I want the first shoot to stay stopped until the enemie be destroyed.
<html>
<head>
<meta charset="utf-8">
<title>Eduardo de Quadros</title>
<style>
@font-face{
font-family: 'Arial';
src: url('assets/arial.ttf');
}
*{
margin: 0px;
color: black;
font-family: 'Arial';
font-size: 20pt;
text-align: justify;
}
header{
background-color: rgb(0, 255, 255);
width: 100%;
}
footer{
background-color: rgb(217, 153, 255);
width: 100%;
}
body{
background-color: rgb(255, 255, 160);
}
h1, h2, h3{
text-align: center;
}
footer h1{
text-align: justify;
padding: 0px 20px;
}
h1{
font-size: 80pt;
}
h2{
font-size: 60pt;
}
h3{
font-size: 40pt;
}
div.div_canvas{
width: 100%;
text-align: center;
}
table.voltar_topo{
bottom: 0px;
right: 0px;
position: fixed;
width: 160px;
}
table.voltar_topo tr td{
background-color: rgb(255, 0, 0);
text-align: center;
height: 160px;
vertical-align: top;
}
table.voltar_topo tr td a{
color: rgb(255, 255, 255);
}
ul.lista_links li, ol.lista_links li{
margin: 80px 0px;
}
ul, ol{
margin: 0px 0px 0px 60px;
}
p{
padding: 0px 20px;
}
p.numero_paginas{
line-height: 120pt;
vertical-align: middle;
}
p.numero_paginas a{
margin: 0px 80px;
}
</style>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
</head>
<body>
<header><h1>Eduardo de Quadros</h1></header><br><br>
<p><a href="../?pagina_videojogos=3&pagina_profissoes_venda_website=1#meus_videojogos">Voltar</a></p><br><br>
<h3>Tiro em 1D</h3><br><br>
<div class="div_canvas" id="tiro_1d"></div><br><br><br>
<script type="text/javascript">
class CarregandoPTTiro1D extends Phaser.Scene{
constructor(){
super('CarregandoPTTiro1D');
}
preload(){
}
create(){
this.titulo = this.add.text(400, 220, "Tiro em 1D", {fontFamily: 'Arial', fontSize: '36pt', color: 'rgb(0, 0, 0)', align: 'center'}).setOrigin(0.5);
this.textoCreditos = this.add.text(400, 300, "Jogo feito por Eduardo de Quadros.", {fontFamily: 'Arial', fontSize: '27pt', color: 'rgb(0, 0, 0)', align: 'center'}).setOrigin(0.5);
this.textoTempo = this.add.text(400, 380, "10", {fontFamily: 'Arial', fontSize: '18pt', color: 'rgb(0, 0, 0)', align: 'center'}).setOrigin(0.5);
this.timer = this.time.addEvent({
delay: 1000,
callback: this.tempoContando,
callbackScope: this,
loop: true
});
}
doisDigitos(numero){
if(numero < 10) return "0" + numero.toString();
else return numero.toString();
}
tempoContando(){
var numeroTempoInt = Number.parseInt(this.textoTempo.text);
if(numeroTempoInt >= 2){
numeroTempoInt--;
this.textoTempo.setText(this.doisDigitos(numeroTempoInt));
}
else{
this.timer.remove();
this.scene.start('JogoPTTiro1D');
this.scene.stop('CarregandoPTTiro1D');
}
}
}
class JogoPTTiro1D extends Phaser.Scene{
constructor(){
super('JogoPTTiro1D');
}
preload(){
this.load.image('area_1d', '../assets/videojogos/tiro_1d/area_1d.png');
this.load.image('inicio', '../assets/videojogos/tiro_1d/inicio.png');
this.load.image('chegada', '../assets/videojogos/tiro_1d/chegada.png');
this.load.image('tiro', '../assets/videojogos/tiro_1d/tiro.png');
this.load.image('jogador', '../assets/videojogos/tiro_1d/jogador.png');
this.load.image('inimigo1', '../assets/videojogos/tiro_1d/inimigo1.png');
this.load.image('inimigo2', '../assets/videojogos/tiro_1d/inimigo2.png');
this.load.image('inimigo3', '../assets/videojogos/tiro_1d/inimigo3.png');
this.load.image('inimigo4', '../assets/videojogos/tiro_1d/inimigo4.png');
this.load.image('inimigo5', '../assets/videojogos/tiro_1d/inimigo5.png');
this.load.image('inimigo6', '../assets/videojogos/tiro_1d/inimigo6.png');
}
create(){
this.area1d = this.add.image(0, 0, 'area_1d').setPosition(0, 300).setOrigin(0, 0);
this.inicio = this.add.image(0, 0, 'inicio').setPosition(0, 300).setOrigin(0, 0);
this.jogador = this.add.image(0, 0, 'jogador').setPosition(50, 300).setOrigin(0, 0);
this.chegada = this.add.image(0, 0, 'chegada').setPosition(8400, 300).setOrigin(0, 0);
var posicoesInimigos = [1200, 2400, 3600, 4800, 6000, 7200];
for(var i = 0; i < 6; i++){
var r = Math.floor(Math.random() * 6);
var aux = posicoesInimigos[i];
posicoesInimigos[i] = posicoesInimigos[r];
posicoesInimigos[r] = aux;
}
this.inimigo1 = this.add.image(0, 0, 'inimigo1').setPosition(posicoesInimigos[0], 300).setOrigin(0, 0);
this.inimigo2 = this.add.image(0, 0, 'inimigo2').setPosition(posicoesInimigos[1], 300).setOrigin(0, 0);
this.inimigo3 = this.add.image(0, 0, 'inimigo3').setPosition(posicoesInimigos[2], 300).setOrigin(0, 0);
this.inimigo4 = this.add.image(0, 0, 'inimigo4').setPosition(posicoesInimigos[3], 300).setOrigin(0, 0);
this.inimigo5 = this.add.image(0, 0, 'inimigo5').setPosition(posicoesInimigos[4], 300).setOrigin(0, 0);
this.inimigo6 = this.add.image(0, 0, 'inimigo6').setPosition(posicoesInimigos[5], 300).setOrigin(0, 0);
this.tiro1 = this.add.image(0, 0, 'tiro').setPosition(110, 300).setOrigin(0, 0);
this.tiro2 = this.add.image(0, 0, 'tiro').setPosition(110, 300).setOrigin(0, 0);
this.tiro3 = this.add.image(0, 0, 'tiro').setPosition(110, 300).setOrigin(0, 0);
this.tiro4 = this.add.image(0, 0, 'tiro').setPosition(110, 300).setOrigin(0, 0);
this.tiro5 = this.add.image(0, 0, 'tiro').setPosition(110, 300).setOrigin(0, 0);
this.tiro6 = this.add.image(0, 0, 'tiro').setPosition(110, 300).setOrigin(0, 0);
this.tiro1.setVisible(false);
this.tiro2.setVisible(false);
this.tiro3.setVisible(false);
this.tiro4.setVisible(false);
this.tiro5.setVisible(false);
this.tiro6.setVisible(false);
window.scene = this;
this.timerJogador = this.time.addEvent({
delay: 30,
callback: this.velocidadeJogador,
callbackScope: this,
loop: true
});
this.timerInimigo = this.time.addEvent({
delay: 900,
callback: this.velocidadeInimigo,
callbackScope: this,
loop: true
});
this.timerTiro = this.time.addEvent({
delay: 1,
callback: this.velocidadeTiro,
callbackScope: this,
loop: true
});
this.numeroTiros = 0;
this.input.on("pointerup", function() {
if(!this.tiro1.visible){
this.tiro1.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro1.setVisible(true);
this.numeroTiros = 1;
}
else if(!this.tiro2.visible){
this.tiro2.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro2.setVisible(true);
this.numeroTiros = 2;
}
else if(!this.tiro3.visible){
this.tiro3.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro3.setVisible(true);
this.numeroTiros = 3;
}
else if(!this.tiro4.visible){
this.tiro4.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro4.setVisible(true);
this.numeroTiros = 4;
}
else if(!this.tiro5.visible){
this.tiro5.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro5.setVisible(true);
this.numeroTiros = 5;
}
else if(!this.tiro6.visible){
this.tiro6.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro6.setVisible(true);
this.numeroTiros = 6;
}
}, this);
}
update(){
var scrol_x = this.jogador.x - 50;
this.cameras.main.scrollX = scrol_x;
if(this.jogador.x == (8450 - 800) + 50) this.cameras.main = this.cameras.main.removeBounds();
if(this.processColidirTiro1Inimigo1()){
this.inimigo1.setVisible(false);
this.tiro1.setVisible(false);
this.tiro2.setVisible(false);
this.tiro3.setVisible(false);
this.tiro4.setVisible(false);
this.tiro5.setVisible(false);
this.tiro6.setVisible(false);
this.tiro1.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro2.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro3.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro4.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro5.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro6.setPosition(this.jogador.x + 60, this.jogador.y);
this.numeroTiros = 0;
}
if(this.processColidirTiro1Inimigo2() && this.processColidirTiro2Tiro1()){
this.inimigo2.setVisible(false);
this.tiro1.setVisible(false);
this.tiro2.setVisible(false);
this.tiro3.setVisible(false);
this.tiro4.setVisible(false);
this.tiro5.setVisible(false);
this.tiro6.setVisible(false);
this.tiro1.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro2.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro3.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro4.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro5.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro6.setPosition(this.jogador.x + 60, this.jogador.y);
this.numeroTiros = 0;
}
if(this.processColidirTiro1Inimigo3() && this.processColidirTiro3Tiro2() && this.processColidirTiro2Tiro1()){
this.inimigo3.setVisible(false);
this.tiro1.setVisible(false);
this.tiro2.setVisible(false);
this.tiro3.setVisible(false);
this.tiro4.setVisible(false);
this.tiro5.setVisible(false);
this.tiro6.setVisible(false);
this.tiro1.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro2.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro3.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro4.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro5.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro6.setPosition(this.jogador.x + 60, this.jogador.y);
this.numeroTiros = 0;
}
if(this.processColidirTiro1Inimigo4() && this.processColidirTiro4Tiro3() && this.processColidirTiro3Tiro2() && this.processColidirTiro2Tiro1()){
this.inimigo4.setVisible(false);
this.tiro1.setVisible(false);
this.tiro2.setVisible(false);
this.tiro3.setVisible(false);
this.tiro4.setVisible(false);
this.tiro5.setVisible(false);
this.tiro6.setVisible(false);
this.tiro1.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro2.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro3.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro4.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro5.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro6.setPosition(this.jogador.x + 60, this.jogador.y);
this.numeroTiros = 0;
}
if(this.processColidirTiro1Inimigo5() && this.processColidirTiro5Tiro4() && this.processColidirTiro4Tiro3() && this.processColidirTiro3Tiro2() && this.processColidirTiro2Tiro1()){
this.inimigo5.setVisible(false);
this.tiro1.setVisible(false);
this.tiro2.setVisible(false);
this.tiro3.setVisible(false);
this.tiro4.setVisible(false);
this.tiro5.setVisible(false);
this.tiro6.setVisible(false);
this.tiro1.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro2.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro3.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro4.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro5.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro6.setPosition(this.jogador.x + 60, this.jogador.y);
this.numeroTiros = 0;
}
if(this.processColidirTiro1Inimigo6() && this.processColidirTiro6Tiro5() && this.processColidirTiro5Tiro4() && this.processColidirTiro4Tiro3() && this.processColidirTiro3Tiro2() && this.processColidirTiro2Tiro1()){
this.inimigo6.setVisible(false);
this.tiro1.setVisible(false);
this.tiro2.setVisible(false);
this.tiro3.setVisible(false);
this.tiro4.setVisible(false);
this.tiro5.setVisible(false);
this.tiro6.setVisible(false);
this.tiro1.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro2.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro3.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro4.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro5.setPosition(this.jogador.x + 60, this.jogador.y);
this.tiro6.setPosition(this.jogador.x + 60, this.jogador.y);
this.numeroTiros = 0;
}
if(this.processColidirJogadorChegada()) this.callbackColidirJogadorChegada();
if(this.processColidirJogadorInimigo1()) this.callbackColidirJogadorInimigo1();
if(this.processColidirJogadorInimigo2()) this.callbackColidirJogadorInimigo2();
if(this.processColidirJogadorInimigo3()) this.callbackColidirJogadorInimigo3();
if(this.processColidirJogadorInimigo4()) this.callbackColidirJogadorInimigo4();
if(this.processColidirJogadorInimigo5()) this.callbackColidirJogadorInimigo5();
if(this.processColidirJogadorInimigo6()) this.callbackColidirJogadorInimigo6();
if(this.processColidirJogadorTiro1()) this.callbackColidirJogadorTiro1();
if(this.processColidirJogadorTiro2()) this.callbackColidirJogadorTiro2();
if(this.processColidirJogadorTiro3()) this.callbackColidirJogadorTiro3();
if(this.processColidirJogadorTiro4()) this.callbackColidirJogadorTiro4();
if(this.processColidirJogadorTiro5()) this.callbackColidirJogadorTiro5();
if(this.processColidirJogadorTiro6()) this.callbackColidirJogadorTiro6();
}
velocidadeInimigo(){
this.inimigo1.setPosition(this.inimigo1.x - 1, this.inimigo1.y);
this.inimigo2.setPosition(this.inimigo2.x - 1, this.inimigo2.y);
this.inimigo3.setPosition(this.inimigo3.x - 1, this.inimigo3.y);
this.inimigo4.setPosition(this.inimigo4.x - 1, this.inimigo4.y);
this.inimigo5.setPosition(this.inimigo5.x - 1, this.inimigo5.y);
this.inimigo6.setPosition(this.inimigo6.x - 1, this.inimigo6.y);
}
velocidadeJogador(){
this.jogador.setPosition(this.jogador.x + 1, this.jogador.y);
}
velocidadeTiro(){
if(this.tiro1.visible && !(this.processColidirTiro1Inimigo1() || this.processColidirTiro1Inimigo2() || this.processColidirTiro1Inimigo3() || this.processColidirTiro1Inimigo4() || this.processColidirTiro1Inimigo5() || this.processColidirTiro1Inimigo6())) this.tiro1.setPosition(this.tiro1.x + 1, this.tiro1.y);
if(this.tiro2.visible && !this.processColidirTiro2Tiro1()) this.tiro2.setPosition(this.tiro2.x + 1, this.tiro2.y);
if(this.tiro3.visible && !this.processColidirTiro3Tiro2()) this.tiro3.setPosition(this.tiro3.x + 1, this.tiro3.y);
if(this.tiro4.visible && !this.processColidirTiro4Tiro3()) this.tiro4.setPosition(this.tiro4.x + 1, this.tiro4.y);
if(this.tiro5.visible && !this.processColidirTiro5Tiro4()) this.tiro5.setPosition(this.tiro5.x + 1, this.tiro5.y);
if(this.tiro6.visible && !this.processColidirTiro6Tiro5()) this.tiro6.setPosition(this.tiro6.x + 1, this.tiro6.y);
}
callbackColidirJogadorChegada(){
this.scene.start('GanhouPTTiro1D');
this.scene.stop('JogoPTTiro1D');
}
callbackColidirJogadorInimigo1(){
this.scene.start('PerdeuPTTiro1D');
this.scene.stop('JogoPTTiro1D');
}
callbackColidirJogadorInimigo2(){
this.scene.start('PerdeuPTTiro1D');
this.scene.stop('JogoPTTiro1D');
}
callbackColidirJogadorInimigo3(){
this.scene.start('PerdeuPTTiro1D');
this.scene.stop('JogoPTTiro1D');
}
callbackColidirJogadorInimigo4(){
this.scene.start('PerdeuPTTiro1D');
this.scene.stop('JogoPTTiro1D');
}
callbackColidirJogadorInimigo5(){
this.scene.start('PerdeuPTTiro1D');
this.scene.stop('JogoPTTiro1D');
}
callbackColidirJogadorInimigo6(){
this.scene.start('PerdeuPTTiro1D');
this.scene.stop('JogoPTTiro1D');
}
callbackColidirJogadorTiro1(){
this.scene.start('PerdeuPTTiro1D');
this.scene.stop('JogoPTTiro1D');
}
callbackColidirJogadorTiro2(){
this.scene.start('PerdeuPTTiro1D');
this.scene.stop('JogoPTTiro1D');
}
callbackColidirJogadorTiro3(){
this.scene.start('PerdeuPTTiro1D');
this.scene.stop('JogoPTTiro1D');
}
callbackColidirJogadorTiro4(){
this.scene.start('PerdeuPTTiro1D');
this.scene.stop('JogoPTTiro1D');
}
callbackColidirJogadorTiro5(){
this.scene.start('PerdeuPTTiro1D');
this.scene.stop('JogoPTTiro1D');
}
callbackColidirJogadorTiro6(){
this.scene.start('PerdeuPTTiro1D');
this.scene.stop('JogoPTTiro1D');
}
processColidirJogadorChegada(){
return this.jogador.x == this.chegada.x - 50;
}
processColidirJogadorInimigo1(){
return this.jogador.x == this.inimigo1.x - 50 && this.inimigo1.visible;
}
processColidirJogadorInimigo2(){
return this.jogador.x == this.inimigo2.x - 50 && this.inimigo2.visible;
}
processColidirJogadorInimigo3(){
return this.jogador.x == this.inimigo3.x - 50 && this.inimigo3.visible;
}
processColidirJogadorInimigo4(){
return this.jogador.x == this.inimigo4.x - 50 && this.inimigo4.visible;
}
processColidirJogadorInimigo5(){
return this.jogador.x == this.inimigo5.x - 50 && this.inimigo5.visible;
}
processColidirJogadorInimigo6(){
return this.jogador.x == this.inimigo6.x - 50 && this.inimigo6.visible;
}
processColidirJogadorTiro1(){
return this.jogador.x == this.tiro1.x - 50 && this.tiro1.visible;
}
processColidirJogadorTiro2(){
return this.jogador.x == this.tiro2.x - 50 && this.tiro2.visible;
}
processColidirJogadorTiro3(){
return this.jogador.x == this.tiro3.x - 50 && this.tiro3.visible;
}
processColidirJogadorTiro4(){
return this.jogador.x == this.tiro4.x - 50 && this.tiro4.visible;
}
processColidirJogadorTiro5(){
return this.jogador.x == this.tiro5.x - 50 && this.tiro5.visible;
}
processColidirJogadorTiro6(){
return this.jogador.x == this.tiro6.x - 50 && this.tiro6.visible;
}
processColidirTiro2Tiro1(){
return this.tiro2.x == this.tiro1.x - 10 && this.tiro2.visible && this.tiro1.visible;
}
processColidirTiro3Tiro2(){
return this.tiro3.x == this.tiro2.x - 10 && this.tiro3.visible && this.tiro2.visible;
}
processColidirTiro4Tiro3(){
return this.tiro4.x == this.tiro3.x - 10 && this.tiro4.visible && this.tiro3.visible;
}
processColidirTiro5Tiro4(){
return this.tiro5.x == this.tiro4.x - 10 && this.tiro5.visible && this.tiro4.visible;
}
processColidirTiro6Tiro5(){
return this.tiro6.x == this.tiro5.x - 10 && this.tiro6.visible && this.tiro5.visible;
}
processColidirTiro1Inimigo1(){
return this.tiro1.x == this.inimigo1.x - 10 && this.tiro1.visible && this.inimigo1.visible;
}
processColidirTiro1Inimigo2(){
return this.tiro1.x == this.inimigo2.x - 10 && this.tiro1.visible && this.inimigo2.visible;
}
processColidirTiro1Inimigo3(){
return this.tiro1.x == this.inimigo3.x - 10 && this.tiro1.visible && this.inimigo3.visible;
}
processColidirTiro1Inimigo4(){
return this.tiro1.x == this.inimigo4.x - 10 && this.tiro1.visible && this.inimigo4.visible;
}
processColidirTiro1Inimigo5(){
return this.tiro1.x == this.inimigo5.x - 10 && this.tiro1.visible && this.inimigo5.visible;
}
processColidirTiro1Inimigo6(){
return this.tiro1.x == this.inimigo6.x - 10 && this.tiro1.visible && this.inimigo6.visible;
}
}
class PerdeuPTTiro1D extends Phaser.Scene{
constructor(){
super('PerdeuPTTiro1D');
}
preload(){
}
create(){
this.titulo = this.add.text(400, 220, "Tiro em 1D", {fontFamily: 'Arial', fontSize: '36pt', color: 'rgb(0, 0, 0)', align: 'center'}).setOrigin(0.5);
this.textoPerdeu = this.add.text(400, 300, "VocĂȘ perdeu!", {fontFamily: 'Arial', fontSize: '27pt', color: 'rgb(0, 0, 0)', align: 'center'}).setOrigin(0.5);
this.textoTempo = this.add.text(400, 380, "5", {fontFamily: 'Arial', fontSize: '18pt', color: 'rgb(0, 0, 0)', align: 'center'}).setOrigin(0.5);
this.timer = this.time.addEvent({
delay: 1000,
callback: this.tempoContando,
callbackScope: this,
loop: true
});
}
tempoContando(){
var numeroTempoInt = Number.parseInt(this.textoTempo.text);
if(numeroTempoInt >= 2){
numeroTempoInt--;
this.textoTempo.setText(numeroTempoInt.toString());
}
else{
this.timer.remove();
this.scene.start('JogoPTTiro1D');
this.scene.stop('PerdeuPTTiro1D');
}
}
}
class GanhouPTTiro1D extends Phaser.Scene{
constructor(){
super('GanhouPTTiro1D');
}
preload(){
}
create(){
this.titulo = this.add.text(400, 220, "Tiro em 1D", {fontFamily: 'Arial', fontSize: '36pt', color: 'rgb(0, 0, 0)', align: 'center'}).setOrigin(0.5);
this.textoPerdeu = this.add.text(400, 300, "VocĂȘ ganhou!", {fontFamily: 'Arial', fontSize: '27pt', color: 'rgb(0, 0, 0)', align: 'center'}).setOrigin(0.5);
this.textoTempo = this.add.text(400, 380, "5", {fontFamily: 'Arial', fontSize: '18pt', color: 'rgb(0, 0, 0)', align: 'center'}).setOrigin(0.5);
this.timer = this.time.addEvent({
delay: 1000,
callback: this.tempoContando,
callbackScope: this,
loop: true
});
}
tempoContando(){
var numeroTempoInt = Number.parseInt(this.textoTempo.text);
if(numeroTempoInt >= 2){
numeroTempoInt--;
this.textoTempo.setText(numeroTempoInt.toString());
}
else{
this.timer.remove();
this.scene.start('JogoPTTiro1D');
this.scene.stop('GanhouPTTiro1D');
}
}
}
var configTiro1D = {
type: Phaser.AUTO,
width: 800,
height: 600,
parent: 'tiro_1d',
physics: {
default: 'arcade',
arcade: {
debug: true
}
},
backgroundColor: 'rgb(128, 128, 128)',
scene: [CarregandoPTTiro1D, JogoPTTiro1D, PerdeuPTTiro1D, GanhouPTTiro1D]
};
var gameTiro1D = new Phaser.Game(configTiro1D);
</script>
<br><br>
<footer><br><h1>Sou um autista, quase se formando em Ciência da Computação e nasci em Chapecó, SC, Brasil, dia 03 de abril de 1998.</h1><br></footer>
</body>
</html>