{"size": 944, "ext": "js", "max_stars_repo_path": "src/objects/Enemies.js", "max_stars_repo_name": "Morskia/phaser_3_space_pirates", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/objects/Enemies.js", "max_issues_repo_name": "Morskia/phaser_3_space_pirates", "max_issues_repo_issues_event_min_datetime": "2021-03-11T01:11:46.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T07:58:20.000Z", "max_forks_repo_path": "src/objects/Enemies.js", "max_forks_repo_name": "Morskia/phaser_3_space_pirates", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 31.4666666667, "max_line_length": 110, "alphanum_fraction": 0.6228813559}
import 'phaser';

export default class enemyShip extends Phaser.GameObjects.Sprite {

    constructor(scene, x, y, lowerCircle, base, gameOptions, group) {
        super(scene, x, y, 'enemy1');
        this.scene = scene;
        this.scene.add.existing(this);
        this.lowerCircle = lowerCircle;
        this.flyAroundBase = base;
        this.gameOptions = gameOptions;
        this.spaceShips = group
        this.radians = Phaser.Math.FloatBetween(0, Math.PI * 2);
        this.speed = Phaser.Math.FloatBetween(0.5, 1);

    }


    update(t, dt) {

        this.radians += this.speed * dt / 1000;
        this.x = this.lowerCircle.x + this.gameOptions.circleRadius * Math.cos(this.radians);
        this.y = this.lowerCircle.y + this.gameOptions.circleRadius * Math.sin(this.radians);
        this.rotation = Phaser.Math.Angle.Between(this.x, this.y, this.flyAroundBase.x, this.flyAroundBase.y)

    }



}