class Radar {

	constructor(owner, options) {

		this.owner = owner;
		this.game = this.owner.game;
		this.imgSprite = null;
		this.animation = null;
		
		var defaults = {

		};

		Object.assign(this, defaults, options);

		this.initialize();
	}

	initialize() {

		this.setupAnimation();
		this.setupImgSprite();
	}

	setupAnimation() {

		this.animation = new ImgSprite(this.game, 'radarAnimation', {
			anchor: 'top-right',
			x: window.innerWidth - 50,
			y: 0 + 50
		});

		this.animation.sprite.animations.add('loop', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 9, true);

		this.animation.sprite.fixedToCamera = true;

		this.animation.sprite.animations.play('loop');

		this.animation.sprite.animations.currentAnim.onLoop.add(function () {

			this.updateRadar();
		}, this);
	}	

	setupImgSprite() {

		this.imgSprite = new ImgSprite(this.game, 'radar', {
			anchor: 'top-right',
			x: window.innerWidth - 50,
			y: 0 + 50
		});

		this.imgSprite.sprite.fixedToCamera = true;
	}

	updateRadar() {

		console.log('radar is updated!');
	}
}