const imgPlayer = new Image(); const imgBullet = new Image(); imgPlayer.src = "./assets/body.png"; imgBullet.src = "./assets/bullet.png"; class Render { constructor(id, mapsrc) { this.canvas = document.getElementById(id); this.ctx = canvas.getContext("2d"); this.players = []; this.bullets = []; this.mapsrc=mapsrc; this.ReloadAff(); } AddPlayer(player) { this.players.push(player); } addBullet(bullet) { this.bullets.push(bullet); } remBullet(bullet) { for(let i=0;i { this.RenderPlayer(player); }) this.bullets.forEach((bullet) => { this.RenderBullet(bullet); }); } }