2020-02-03 17:07:43 +01:00
|
|
|
[gd_scene load_steps=8 format=2]
|
2019-12-19 21:24:40 +01:00
|
|
|
|
2020-01-16 09:44:44 +01:00
|
|
|
[ext_resource path="res://demos/PursueSeek/Pursuer.gd" type="Script" id=1]
|
|
|
|
[ext_resource path="res://demos/PursueSeek/Player.gd" type="Script" id=2]
|
|
|
|
[ext_resource path="res://demos/PursueSeek/BoundaryManager.gd" type="Script" id=3]
|
2020-02-08 16:36:06 +01:00
|
|
|
[ext_resource path="res://demos/PursueSeek/PursueAndSeekDemo.gd" type="Script" id=4]
|
2020-01-16 16:04:27 +01:00
|
|
|
[ext_resource path="res://assets/theme/gdquest.theme" type="Theme" id=5]
|
2020-02-04 11:10:07 +01:00
|
|
|
[ext_resource path="res://demos/Utils/Line2DDraw.gd" type="Script" id=6]
|
2020-02-03 17:07:43 +01:00
|
|
|
[ext_resource path="res://assets/sprites/background.png" type="Texture" id=7]
|
2019-12-19 21:24:40 +01:00
|
|
|
|
2019-12-23 17:38:27 +01:00
|
|
|
[node name="PursueVSSeekDemo" type="Node2D"]
|
|
|
|
script = ExtResource( 4 )
|
2019-12-19 21:24:40 +01:00
|
|
|
__meta__ = {
|
|
|
|
"_editor_description_": "Toy demo to demonstrate the use of the Pursue contrasted to the more naive Seek steering behavior."
|
|
|
|
}
|
2020-01-22 17:55:49 +01:00
|
|
|
linear_speed_max = 240.0
|
|
|
|
linear_accel_max = 40.0
|
2020-01-29 16:04:47 +01:00
|
|
|
predict_time = 1.1
|
2019-12-19 21:24:40 +01:00
|
|
|
|
2020-02-03 17:07:43 +01:00
|
|
|
[node name="BackgroudLayer" type="CanvasLayer" parent="."]
|
|
|
|
layer = -1
|
|
|
|
|
|
|
|
[node name="Background" type="Sprite" parent="BackgroudLayer"]
|
|
|
|
texture = ExtResource( 7 )
|
|
|
|
centered = false
|
|
|
|
|
2019-12-19 21:24:40 +01:00
|
|
|
[node name="BoundaryManager" type="Node2D" parent="."]
|
2019-12-23 17:38:27 +01:00
|
|
|
script = ExtResource( 3 )
|
2019-12-19 21:24:40 +01:00
|
|
|
|
|
|
|
[node name="Player" type="KinematicBody2D" parent="BoundaryManager"]
|
2020-01-29 16:04:47 +01:00
|
|
|
position = Vector2( 47.3369, 329.724 )
|
2019-12-19 21:24:40 +01:00
|
|
|
rotation = 1.5708
|
|
|
|
collision_mask = 2
|
2019-12-23 17:38:27 +01:00
|
|
|
script = ExtResource( 2 )
|
2020-01-16 16:04:27 +01:00
|
|
|
thruster_strength = 600.0
|
|
|
|
side_thruster_strength = 20.0
|
2019-12-19 21:24:40 +01:00
|
|
|
|
|
|
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="BoundaryManager/Player"]
|
2020-01-13 22:15:44 +01:00
|
|
|
polygon = PoolVector2Array( 0, -32, -24, 32, 24, 32 )
|
|
|
|
|
2020-02-04 11:10:07 +01:00
|
|
|
[node name="Line2D" type="Line2D" parent="BoundaryManager/Player"]
|
|
|
|
points = PoolVector2Array( 0, 32, 24, 32, 0, -32, -24, 32, 0, 32 )
|
|
|
|
width = 8.0
|
|
|
|
default_color = Color( 0.560784, 0.870588, 0.364706, 1 )
|
|
|
|
joint_mode = 2
|
|
|
|
antialiased = true
|
|
|
|
script = ExtResource( 6 )
|
|
|
|
inner_color = Color( 0.235294, 0.639216, 0.439216, 1 )
|
2019-12-19 21:24:40 +01:00
|
|
|
|
|
|
|
[node name="Pursuer" type="KinematicBody2D" parent="BoundaryManager"]
|
2020-01-29 16:04:47 +01:00
|
|
|
position = Vector2( 980, 550 )
|
2019-12-19 21:24:40 +01:00
|
|
|
collision_layer = 2
|
|
|
|
script = ExtResource( 1 )
|
|
|
|
|
|
|
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="BoundaryManager/Pursuer"]
|
2020-01-13 22:15:44 +01:00
|
|
|
polygon = PoolVector2Array( 0, -32, -24, 32, 24, 32 )
|
|
|
|
|
2020-02-04 11:10:07 +01:00
|
|
|
[node name="Line2D" type="Line2D" parent="BoundaryManager/Pursuer"]
|
|
|
|
points = PoolVector2Array( 0, 32, 24, 32, 0, -32, -24, 32, 0, 32 )
|
|
|
|
width = 8.0
|
|
|
|
default_color = Color( 1, 0.709804, 0.439216, 1 )
|
|
|
|
joint_mode = 2
|
|
|
|
antialiased = true
|
|
|
|
script = ExtResource( 6 )
|
|
|
|
inner_color = Color( 0.890196, 0.411765, 0.337255, 1 )
|
2019-12-19 21:24:40 +01:00
|
|
|
|
|
|
|
[node name="Seeker" type="KinematicBody2D" parent="BoundaryManager"]
|
2020-01-29 16:04:47 +01:00
|
|
|
position = Vector2( 980, 150 )
|
|
|
|
rotation = 3.14159
|
2019-12-19 21:24:40 +01:00
|
|
|
collision_layer = 2
|
|
|
|
script = ExtResource( 1 )
|
|
|
|
use_seek = true
|
|
|
|
|
|
|
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="BoundaryManager/Seeker"]
|
2020-01-13 22:15:44 +01:00
|
|
|
polygon = PoolVector2Array( 0, -32, -24, 32, 24, 32 )
|
|
|
|
|
2020-02-04 11:10:07 +01:00
|
|
|
[node name="Line2D" type="Line2D" parent="BoundaryManager/Seeker"]
|
|
|
|
points = PoolVector2Array( 0, 32, 24, 32, 0, -32, -24, 32, 0, 32 )
|
|
|
|
width = 8.0
|
|
|
|
default_color = Color( 0.301961, 0.65098, 1, 1 )
|
|
|
|
joint_mode = 2
|
|
|
|
antialiased = true
|
|
|
|
script = ExtResource( 6 )
|
|
|
|
inner_color = Color( 0.294118, 0.356863, 0.670588, 1 )
|
2020-01-16 16:04:27 +01:00
|
|
|
|
|
|
|
[node name="GUI" type="PanelContainer" parent="."]
|
|
|
|
margin_right = 1024.0
|
|
|
|
margin_bottom = 14.0
|
|
|
|
theme = ExtResource( 5 )
|
|
|
|
__meta__ = {
|
|
|
|
"_edit_use_anchors_": false
|
|
|
|
}
|
|
|
|
|
|
|
|
[node name="MarginContainer" type="MarginContainer" parent="GUI"]
|
|
|
|
margin_right = 1024.0
|
|
|
|
margin_bottom = 116.0
|
|
|
|
|
|
|
|
[node name="RichTextLabel" type="RichTextLabel" parent="GUI/MarginContainer"]
|
|
|
|
margin_left = 16.0
|
|
|
|
margin_top = 16.0
|
|
|
|
margin_right = 1008.0
|
|
|
|
margin_bottom = 100.0
|
|
|
|
rect_min_size = Vector2( 0, 84 )
|
|
|
|
bbcode_enabled = true
|
|
|
|
bbcode_text = "Pursue vs. Seek Demo
|
2020-02-04 11:10:07 +01:00
|
|
|
Move the player around with WASD and notice the [color=#ffb570]orange Pursuer[/color] and the [color=aqua]blue Seeker[/color] follow
|
|
|
|
the [color=lime]green \"Ship\"[/color] around"
|
2020-01-16 16:04:27 +01:00
|
|
|
text = "Pursue vs. Seek Demo
|
2020-02-04 11:10:07 +01:00
|
|
|
Move the player around with WASD and notice the orange Pursuer and the blue Seeker follow
|
|
|
|
the green \"Ship\" around"
|
2020-01-16 16:04:27 +01:00
|
|
|
scroll_active = false
|