godot_boids/examples/boids/2d/example_boid.tscn

26 lines
775 B
Plaintext

[gd_scene load_steps=4 format=3 uid="uid://b2sg3n42rkbx8"]
[ext_resource type="Texture2D" uid="uid://rk5u1wthr0n0" path="res://examples/boids/2d/example_boid.svg" id="2_jx2vb"]
[sub_resource type="BoidProperties" id="BoidProperties_a6wou"]
alignment = 1.0
cohesion = 0.8
[sub_resource type="GDScript" id="GDScript_ldfpo"]
resource_name = "example_boid_sprite"
script/source = "extends Sprite2D
@onready var boid: Boid2D = get_parent()
func _process(delta: float) -> void:
var dir_target := boid.global_position + boid.get_velocity()
look_at(dir_target)
"
[node name="ExampleBoid" type="Boid2D"]
properties = SubResource("BoidProperties_a6wou")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_jx2vb")
script = SubResource("GDScript_ldfpo")