fix goal state
This commit is contained in:
51
godot/goal/Goal.tscn
Normal file
51
godot/goal/Goal.tscn
Normal file
@@ -0,0 +1,51 @@
|
||||
[gd_scene load_steps=9 format=2]
|
||||
|
||||
[ext_resource path="res://assets/flag.png" type="Texture" id=1]
|
||||
[ext_resource path="res://goal/GoalNotReached.gdns" type="Script" id=2]
|
||||
[ext_resource path="res://goal/GoalReached.gdns" type="Script" id=3]
|
||||
[ext_resource path="res://state_machine/StateMachine.gdns" type="Script" id=4]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=5]
|
||||
extents = Vector2( 10, 18 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=6]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 0, 0, 18, 36 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=7]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 18, 0, 18, 36 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=8]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 6 ), SubResource( 7 ) ],
|
||||
"loop": true,
|
||||
"name": "flagmove",
|
||||
"speed": 5.0
|
||||
} ]
|
||||
|
||||
[node name="Goal" type="Area2D"]
|
||||
position = Vector2( 324, 378 )
|
||||
collision_layer = 32
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 18, 18 )
|
||||
shape = SubResource( 5 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
position = Vector2( 18, 18 )
|
||||
frames = SubResource( 8 )
|
||||
animation = "flagmove"
|
||||
frame = 1
|
||||
playing = true
|
||||
|
||||
[node name="StateMachine" type="Node" parent="."]
|
||||
script = ExtResource( 4 )
|
||||
|
||||
[node name="GoalReached" type="Node" parent="StateMachine"]
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="GoalNotReached" type="Node" parent="StateMachine"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[connection signal="body_entered" from="." to="StateMachine/GoalNotReached" method="_on_Goal_body_entered"]
|
8
godot/goal/GoalNotReached.gdns
Normal file
8
godot/goal/GoalNotReached.gdns
Normal file
@@ -0,0 +1,8 @@
|
||||
[gd_resource type="NativeScript" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://gdnative/alai.tres" type="GDNativeLibrary" id=1]
|
||||
|
||||
[resource]
|
||||
resource_name = "GoalNotReached"
|
||||
class_name = "GoalNotReached"
|
||||
library = ExtResource( 1 )
|
8
godot/goal/GoalReached.gdns
Normal file
8
godot/goal/GoalReached.gdns
Normal file
@@ -0,0 +1,8 @@
|
||||
[gd_resource type="NativeScript" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://gdnative/alai.tres" type="GDNativeLibrary" id=1]
|
||||
|
||||
[resource]
|
||||
resource_name = "GoalReached"
|
||||
class_name = "GoalReached"
|
||||
library = ExtResource( 1 )
|
Reference in New Issue
Block a user