const canvas = document.querySelector("#canvas"),
ctx = canvas.getContext("2d");
// Set canvas width & height;
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
// show ground
const ground = new Image();
ground.src = "assets/img/ground.jpg";
ground.onload = function(){
ctx.drawImage(this, 0, 0, 660, 440, 0, 0, 400, 200);
}
this.a = [posx,posy,prx,pry] = [].concat(x,y,x,y);
class Particle {
constructor(x, y) {
return Object.assign(this, {
posx: x,
posy: y,
prx: x,
pry: y
});
}
}