Fix demo picker blank scene

It did not have a file path by default, but had an index.
Also, the camera on Seek/Flee caused the Go Back button not to show.
The scene's been amended and the camera removed, since it wasn't
actually useful.
This commit is contained in:
Francois Belair 2020-02-08 11:44:54 -05:00
parent b6226d45b0
commit 5627a5636a
5 changed files with 17 additions and 17 deletions

View File

@ -14,6 +14,7 @@ func _ready() -> void:
list.connect("demo_selected", self, "set_demo_path")
list.connect("item_activated", self, "emit_signal", ["demo_requested"])
button.connect("pressed", self, "emit_signal", ["demo_requested"])
demo_path = list.file_paths[0]
func set_demo_path(value: String) -> void:

View File

@ -8,7 +8,6 @@
[ext_resource path="res://demos/Utils/Line2DDraw.gd" type="Script" id=6]
[ext_resource path="res://assets/sprites/background.png" type="Texture" id=7]
[node name="PursueVSSeekDemo" type="Node2D"]
script = ExtResource( 4 )
__meta__ = {

View File

@ -3,7 +3,11 @@ extends KinematicBody2D
var speed: float
var agent := GSTAgentLocation.new()
onready var agent := GSTAgentLocation.new()
func _ready() -> void:
agent.position = GSTUtils.to_vector3(global_position)
func _physics_process(delta: float) -> void:
@ -12,7 +16,7 @@ func _physics_process(delta: float) -> void:
return
move_and_slide(movement * speed)
agent.position = Vector3(global_position.x, global_position.y, 0)
agent.position = GSTUtils.to_vector3(global_position)
func _get_movement() -> Vector2:

View File

@ -31,8 +31,8 @@ func _ready() -> void:
for i in range(spawner.entity_count):
var new_pos := Vector2(
rng.randf_range(-camera_boundaries.size.x/2, camera_boundaries.size.x/2),
rng.randf_range(-camera_boundaries.size.y/2, camera_boundaries.size.y/2)
rng.randf_range(0, camera_boundaries.size.x),
rng.randf_range(0, camera_boundaries.size.y)
)
var entity: KinematicBody2D = spawner.Entity.instance()
entity.global_position = new_pos

View File

@ -31,10 +31,8 @@ layer = -1
texture = ExtResource( 8 )
centered = false
[node name="Camera2D" type="Camera2D" parent="."]
current = true
[node name="Player" type="KinematicBody2D" parent="."]
position = Vector2( 512, 300 )
collision_mask = 2
script = ExtResource( 2 )
@ -46,7 +44,7 @@ outer_color = Color( 0.560784, 0.870588, 0.364706, 1 )
stroke = 4.0
[node name="LeftBoundary" type="StaticBody2D" parent="."]
position = Vector2( -512, 0 )
position = Vector2( 0, 300 )
collision_layer = 2
collision_mask = 5
script = ExtResource( 1 )
@ -55,7 +53,7 @@ script = ExtResource( 1 )
shape = SubResource( 2 )
[node name="RightBoundary" type="StaticBody2D" parent="."]
position = Vector2( 512, 0 )
position = Vector2( 1024, 300 )
collision_layer = 2
collision_mask = 5
script = ExtResource( 1 )
@ -64,7 +62,7 @@ script = ExtResource( 1 )
shape = SubResource( 2 )
[node name="TopBoundary" type="StaticBody2D" parent="."]
position = Vector2( 0, -300 )
position = Vector2( 512, 0 )
collision_layer = 2
collision_mask = 5
script = ExtResource( 1 )
@ -73,7 +71,7 @@ script = ExtResource( 1 )
shape = SubResource( 3 )
[node name="BottomBoundary" type="StaticBody2D" parent="."]
position = Vector2( 0, 300 )
position = Vector2( 512, 600 )
collision_layer = 2
collision_mask = 5
script = ExtResource( 1 )
@ -85,9 +83,7 @@ shape = SubResource( 3 )
script = ExtResource( 4 )
Entity = ExtResource( 6 )
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="GUI" type="PanelContainer" parent="CanvasLayer"]
[node name="GUI" type="PanelContainer" parent="."]
margin_right = 1024.0
margin_bottom = 116.0
theme = ExtResource( 5 )
@ -95,11 +91,11 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="MarginContainer" type="MarginContainer" parent="CanvasLayer/GUI"]
[node name="MarginContainer" type="MarginContainer" parent="GUI"]
margin_right = 1024.0
margin_bottom = 116.0
[node name="RichTextLabel" type="RichTextLabel" parent="CanvasLayer/GUI/MarginContainer"]
[node name="RichTextLabel" type="RichTextLabel" parent="GUI/MarginContainer"]
margin_left = 16.0
margin_top = 16.0
margin_right = 1008.0