function draw() {
  if(updateFrames == false) {return};

  canvas.clearRect(0, 0, 480, 320);       // clear the canvas
  player.draw();                          // draw the player
  canvas.fillText("SCORE " + score,5,10); // draw the current score

  // draw the enemies
  playerEnemies.forEach(function(Enemy) {
    Enemy.draw();
  });

  // draw the bullets
  playerBullets.forEach(function(bullet) {
    bullet.draw();
  });
}
// this is the main drawing function
this is the main drawing function
this is the main drawing function
function draw() {
  if(updateFrames == false) {return};
  canvas.clearRect(0, 0, 480, 320);       
  player.draw();                          
  canvas.fillText("SCORE " + score,5,10); 
  playerEnemies.forEach(function(Enemy) {
    Enemy.draw();
  });
  playerBullets.forEach(function(bullet) {
    bullet.draw();
  });
}
function draw ( ) { if ( updateFrames == false ) { return } ; canvas . clearRect ( 0 , 0 , 480 , 320 ) ; player . draw ( ) ; canvas . fillText ( "SCORE " + score , 5 , 10 ) ; playerEnemies . forEach ( function ( Enemy ) { Enemy . draw ( ) ; } ) ; playerBullets . forEach ( function ( bullet ) { bullet . draw ( ) ; } ) ; }
this is the main drawing function
this is the main drawing function
// clear the canvas // draw the player // draw the current score // draw the enemies // draw the bullets