14 lines
273 B
GDScript
14 lines
273 B
GDScript
extends Line2D
|
|
|
|
|
|
func _ready() -> void:
|
|
var staticbody:StaticBody2D=get_child(0)
|
|
$".".visible=false
|
|
|
|
|
|
var line_poly=Geometry2D.offset_polyline(points,width/2)
|
|
|
|
for poly in line_poly:
|
|
var col = CollisionPolygon2D.new()
|
|
col.polygon=poly
|
|
staticbody.add_child(col)
|