"use strict";
/* In today's performance, the role of Charon will be played by Hades... */
var GO_Death = function(){
	this.sprite = new Sprite(GO_Death.spriteSheet,"Death");
	this.sprite.collision_flags = 
		DEFINE_SPRITE_COLLISION_FLAGS.GROUND | 
		DEFINE_SPRITE_COLLISION_FLAGS.AIR |
		DEFINE_SPRITE_COLLISION_FLAGS.SPRITES_ACTIVE |
		DEFINE_SPRITE_COLLISION_FLAGS.SPRITES_PASSIVE;
	this.sprite.setBoundingBox(2,0,13,15);
	this.sprite.game_object = this; // no longer a generic GO
	
	this.frame_timer=0;

	this.direction = 1; // +/-1 for facing
};
GO_Death.spriteImg = SDS_Load_Image("art/sheets/sprite/death.png");
GO_Death.spriteSheet = new TileSheet(4, 4, 2, 1, GO_Death.spriteImg);

GO_Death.prototype = new GameObject(
	new Sprite(
		GO_Death.spriteSheet,
		"Death"
	),
	"Death"
	);

	GO_Death.prototype.interactions = 
		DEFINE_GAMEOBJECT_INTERACTIONS.CHECK;

	GO_Death.prototype.checkEvent = function(sourceGO){
		if (sourceGO && sourceGO.sprite) this.direction = (sourceGO.sprite.x<this.sprite.x) ? -1 : 1;
		
		return Dialogue_getCurrentEvent["Death"]();
	};

	GO_Death.prototype.Update = function(){
		this.sprite.frame = 0;
		if (this.direction<0) this.sprite.frame+=4;
	};
