/*
* A static spike for lining walls which hurts without per se blocking
*/
"use strict";
// orientation:
// 0: top-facing
// 1: right-facing
// 2: down-facing
// 3: left-facing
var GO_Skewer = function(orientation,idx){
	idx = idx ? idx&3 : 0;
	this.sprite = null;
	switch(orientation){
		case 3:
			this.sprite = new Sprite(GO_Skewer.spriteSheetV,"Skewer");
			this.sprite.collision_flags = 
				DEFINE_SPRITE_COLLISION_FLAGS.SPRITES_PASSIVE;
			this.sprite.setBoundingBox(1,1,15,6);
			this.sprite.frame = 3+(idx<<2);
		break;
		case 2:
			this.sprite = new Sprite(GO_Skewer.spriteSheetH,"Skewer");
			this.sprite.collision_flags = 
				DEFINE_SPRITE_COLLISION_FLAGS.SPRITES_PASSIVE;
			this.sprite.setBoundingBox(1,0,6,14);
			this.sprite.frame = idx;
		break;
		case 1:
			this.sprite = new Sprite(GO_Skewer.spriteSheetV,"Skewer");
			this.sprite.collision_flags = 
				DEFINE_SPRITE_COLLISION_FLAGS.SPRITES_PASSIVE;
			this.sprite.setBoundingBox(0,1,14,6);
			this.sprite.frame = 2+(idx<<2);
		break;
		default:
			this.sprite = new Sprite(GO_Skewer.spriteSheetH,"Skewer");
			this.sprite.collision_flags = 
				DEFINE_SPRITE_COLLISION_FLAGS.SPRITES_PASSIVE;
			this.sprite.setBoundingBox(1,1,6,15);
			this.sprite.frame = 8+idx;
		break;
	}


	//sprite.constraints=constraints;
	this.sprite.max_step = 0;
	this.sprite.game_object = this; // no longer a generic GO
};
GO_Skewer.spriteImg = SDS_Load_Image("art/sheets/sprite/dark_spikes.png");
GO_Skewer.spriteSheetH = new TileSheet(3, 4, 3, 1, GO_Skewer.spriteImg);
GO_Skewer.spriteSheetV = new TileSheet(4, 3, 2, 2, GO_Skewer.spriteImg);

GO_Skewer.prototype = new GameObject(
	new Sprite(
		GO_Skewer.spriteSheet,
		"Skewer"
	),
	"Skewer"
	);

	GO_Skewer.prototype.interactions = DEFINE_GAMEOBJECT_INTERACTIONS.INFLICT;

	GO_Skewer.prototype.inflict = function(){
		return {hp: 3, chi:0};
	};

	GO_Skewer.prototype.Update = function(){

	};



