"use strict";

var GO_GhostVortex = function(unlocked,getDestName,relocate){
	this.sprite = new Sprite(GO_GhostVortex.spriteSheet,"GhostVortex");
	
	this.sprite.collision_flags = 
		DEFINE_SPRITE_COLLISION_FLAGS.SPRITES_PASSIVE;
	this.sprite.setBoundingBox(3,3,28,28);
	this.sprite.game_object = this; // no longer a generic GO

	this.unlocked=unlocked;
	this._getDestName = getDestName;
	this.relocate = relocate;

	this.framecounter = 0;
};
GO_GhostVortex.spriteImg = SDS_Load_Image("art/sheets/sprite/ghostvortex.png");
GO_GhostVortex.spriteSheet = new TileSheet(5, 5, 2, 0, GO_GhostVortex.spriteImg);

GO_GhostVortex.prototype = new GameObject(
	new Sprite(
		GO_Door.spriteSheet,
		"GhostVortex"
	),
	"GhostVortex"
	);

	GO_GhostVortex.prototype.interactions = 
		DEFINE_GAMEOBJECT_INTERACTIONS.PORT;

	GO_GhostVortex.prototype.getDestName = function(){
		return this.unlocked ? this._getDestName() : null;
	};

	GO_GhostVortex.prototype.Update = function(){
		this.framecounter = (this.framecounter+1)%12;
		this.sprite.frame = !this.unlocked ? 3 : (this.framecounter&1) ? 3 : this.framecounter>>2;
	};
