tool
class_name Stairs
extends Area2D

export var count = 1
onready var coll = $"CollisionShape"

func make_poly():
	var array = PoolVector2Array()
	array.push_back(Vector2(0, 0))
	array.push_back(Vector2(-8, 0))
	array.push_back(Vector2(-8, 8))
	array.push_back(Vector2(0, 8))
	array.push_back(Vector2(0, 32))
	array.push_back(Vector2(0, count * 16 + 32))
	array.push_back(Vector2(count * 16, count * 16 + 32))
	#array.push_back(Vector2(count * 16 + 4, count * 16 + 16))
	#array.push_back(Vector2(count * 16 + 4, count * 16))
	array.push_back(Vector2(count * 16, count * 16))
	return array

func _ready():
	coll.set_polygon(make_poly())

func _process(_delta):
	if Engine.editor_hint:
		if coll != null:
			coll.set_polygon(make_poly())
