/*
Soul drops which increase the life total
*/

"use strict";

var GO_MeliSoul = function(){
	this.sprite = new Sprite(GO_MeliSoul.spriteSheet,"MeliSoul");
	this.sprite.collision_flags = 
		DEFINE_SPRITE_COLLISION_FLAGS.SPRITES_PASSIVE;
	this.sprite.setBoundingBox(2,2,13,13);
	this.sprite.game_object = this; // no longer a generic GO

	this.soulname = "MELI";
		
	this.frame_timer=0;
}
GO_MeliSoul.spriteImg = SDS_Load_Image("art/sheets/sprite/drops.png");
GO_MeliSoul.spriteSheet = new TileSheet(4, 4, 2, 3, GO_MeliSoul.spriteImg);

GO_MeliSoul.prototype = new GameObject(
	new Sprite(
		GO_MeliSoul.spriteSheet,
		"Soul"
	),
	"Soul"
	);

	GO_MeliSoul.prototype.interactions = 
		DEFINE_GAMEOBJECT_INTERACTIONS.COLLECT;

	GO_MeliSoul.prototype.collect = function(sourceGO){
		this.sprite.map_room.removeSprite(this.sprite);
		this.manager.remove(this);
		GLOBAL_DIARY.collectSoul(this.soulname);
		return "Meli_Soul";
	};

	GO_MeliSoul.prototype.Update = function(){
		this.frame_timer++;
		this.frame_timer&=15;
		this.sprite.frame = this.frame_timer>>2;
		
		this.sprite.frame+=12;
	};
	