class enemySpike extends Phaser.Physics.Arcade.Sprite {
    constructor(scene, xPos, yPos, texture) {
        super(scene, xPos, yPos, texture);
        /** had to do this to create a physics body */ 
        scene.physics.add.existing(this);
        /** set up the physics properties */
        this.setBounce(0.2);
        this.setCollideWorldBounds(true);
        /** Add is to the scene to make it visible/active etc */
        scene.add.existing(this);
    } /**  constructor() */


    updateMove(){

    if (enemySpike_spr.y >= 900)/** if equal or greater than */ {
        enemySpike_spr.setVelocityY(-300);
        //set's the velocity which moves the enemy up
        this.anims.play('enemy');
        // plays the enemy animation

    } else if (enemySpike_spr.y <= 500)/** if equal or lesser than */ {
        enemySpike_spr.setVelocityY(300);
        //set's the velocity which moves the enemy down
        this.anims.play('enemy');
        // plays the enemy animation
    }
  } /** end of updateMe() */

  
  updateMove2(){

    if (enemySpike_spr2.y >= 1100)/** if equal or greater than */ {
        enemySpike_spr2.setVelocityY(-300);
        //set's the velocity which moves the enemy up
        this.anims.play('enemy');
        // plays the enemy animation
    } else if (enemySpike_spr2.y <= 700)/** if equal or lesser than */ {
        enemySpike_spr2.setVelocityY(300);
        //set's the velocity which moves the enemy down
        this.anims.play('enemy');
        // plays the enemy animation
    }
  } /** end of updateMe() */

  updateMove3(){

    if (enemySpike_spr3.y >= 1600)/** if equal or greater than */ {
        enemySpike_spr3.setVelocityY(-300);
        //set's the velocity which moves the enemy up
        this.anims.play('enemy');
        // plays the enemy animation
    } else if (enemySpike_spr3.y <= 1200)/** if equal or lesser than */ {
        enemySpike_spr3.setVelocityY(300);
        //set's the velocity which moves the enemy down
        this.anims.play('enemy');
        // plays the enemy animation
    }
  } /** end of updateMe() */

  updateMove4(){

    if (enemySpike_spr4.y >= 2000)/** if equal or greater than */ {
        enemySpike_spr4.setVelocityY(-300);
        //set's the velocity which moves the enemy up
        this.anims.play('enemy');
        // plays the enemy animation
    } else if (enemySpike_spr4.y <= 1600)/** if equal or lesser than */ {
        enemySpike_spr4.setVelocityY(300);
        //set's the velocity which moves the enemy down
        this.anims.play('enemy');
        // plays the enemy animation
    }
  } /** end of updateMe() */

  
} /** end of class */