
@BaseScript(EntityTypeScript.class)

@BaseScript(EntityTypeScript)
/**
 * 
 */
package scripts.types

import groovy.transform.BaseScript
import studio.junk.jam.coloritum.EntityTypeScript
import studio.junk.jam.coloritum.entities.components.MirrorComponent
import studio.junk.jam.coloritum.entities.components.Placable
import studio.junk.jam.coloritum.entities.components.SpriteComponent
import studio.junk.jam.coloritum.entities.components.TilePosition
import studio.junk.jam.coloritum.entities.components.MirrorComponent.Orientation

import com.badlogic.gdx.graphics.g2d.Sprite
import com.badlogic.gdx.math.MathUtils
import com.badlogic.gdx.math.Vector2


/**
 * Needs arguments as:
 * Vector2 args[0]: position
 * MirrorComponent.Orientation args[1]: orientation
 * @author cryptjar
 *
 */

entity {
	addStaticBox this.args[0], new Vector2(1, MirrorComponent.width), (float)(MathUtils.PI/4)
	add new TilePosition(this.args[0])
	add new MirrorComponent(this.args[1])
	Sprite s = new Sprite(this.getTexture("mirror"));
	if (this.args[1] == Orientation.NorthEast)
		s.rotate90(false)
	add new SpriteComponent(s)
	
	add new Placable()
}


