// ----------------------------------
// RSDK Project: Sonic 1
// Script Description: Solid Block Object
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

// ========================
// Function Declarations
// ========================

reserve function SolidBlock_DebugDraw
reserve function SolidBlock_DebugSpawn


// ========================
// Function Definitions
// ========================

private function SolidBlock_DebugDraw
	DrawSprite(0)
end function


private function SolidBlock_DebugSpawn
	CreateTempObject(TypeName[Solid Block], 0, object.xpos, object.ypos)
end function


// ========================
// Events
// ========================

event ObjectUpdate
	foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
		BoxCollisionTest(C_SOLID, object.entityPos, -16, -16, 16, 16, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
	next
end event


event ObjectDraw
	DrawSprite(0)
end event


event ObjectStartup
	LoadSpriteSheet("LZ/Objects.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 18)

	SetTableValue(TypeName[Solid Block], DebugMode_ObjCount, DebugMode_TypesTable)
	SetTableValue(SolidBlock_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
	SetTableValue(SolidBlock_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
	DebugMode_ObjCount++
end event


// ========================
// Editor Events
// ========================

event RSDKDraw
	DrawSprite(0)
end event


event RSDKLoad
	LoadSpriteSheet("LZ/Objects.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 18)
	
	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end event
