Air Combat Demo

A very simple demo of air combats
air-combat.html

6 Likes

Nice! :grin:

I think it would be more fun if you could hold the mouse button to fire, I’m not a fan of frantic clicking. Otherwise great work.

4 Likes

I think I enjoy crazy-clicking more:)
You can edit the source to implement continuous shooting function see below.
PATCH:

class Input{
constructor(domElement,camera){
this.mouseX=this.mouseY=0;
this.clicked=false;
let mousemove = event=> {
let rect=domElement.getBoundingClientRect();
this.mouseX=(event.clientX-rect.left)/rect.width2-1;
this.mouseY=-(event.clientY-rect.top)/rect.height
2+1;
};
let mousedown=event=>{
if(event.button==0)
this.clicked=true;
}
let mouseup=event=>{
this.clicked=false;
}
domElement.addEventListener(“mousemove”,mousemove);
domElement.addEventListener(“mousedown”,mousedown);
domElement.addEventListener(“mouseup”,mouseup);
}
update(dt){
//this.clicked=false;
}
}

Very enjoyable!