@BaseScript(EntityTypeScript)

package scripts.types

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

import com.badlogic.gdx.math.Vector2

/**
 * @param args[0] int posX
 * @param args[1] int posY
 * @param args[2] Sprite sprite
 * 
 */
entity {
	Vector2 pos = new Vector2(this.args[0], this.args[1])
	addStaticBox pos, new Vector2(1f, 1f), 0f
	add new TilePosition(pos.cpy())
	add new SpriteComponent((this.args.length > 2) ? (this.args[2]) : (this.getTexture("obstacle90")));
}
