Skip to content

Commit

Permalink
keys
Browse files Browse the repository at this point in the history
  • Loading branch information
drxwat committed Jun 16, 2021
1 parent 6357f56 commit 627f799
Show file tree
Hide file tree
Showing 11 changed files with 223 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .import/key-white.png-2b8bb1b5bdc3f1a6eb1d91c5bac5f0d7.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="fc61d2240f818a627a05373bcf4e0f92"
dest_md5="3f69fa13ee1b84ebba731b5e5cd520fd"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/key.png-a97df9ba773df86f934812b8b28ef996.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="28a73785c9778eb7c8fbed2133d194b3"
dest_md5="04d987f9f2c6a4840d35fc3b397bcb46"

Binary file not shown.
2 changes: 1 addition & 1 deletion GOAP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void _Process(float delta)
{
GD.Print("START!");
var goals = new List<IReGoapGoal<string, object>>();
// goals.Add(new MoveToGoal(targetPosition.GlobalPosition));
goals.Add(new MoveToGoal(targetPosition.GlobalPosition));
goals.Add(new HasItem("Key"));
unit.setGoals(goals);
unit.GoapAgent.ForceCalculateNewGoal();
Expand Down
29 changes: 27 additions & 2 deletions GOAP.tscn
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[gd_scene load_steps=10 format=2]
[gd_scene load_steps=11 format=2]

[ext_resource path="res://AI/units/goap-unit/GoapUnit.tscn" type="PackedScene" id=1]
[ext_resource path="res://tilesets/wall-1-tilests.tres" type="TileSet" id=2]
[ext_resource path="res://tilesets/ground-1-tileset.tres" type="TileSet" id=3]
[ext_resource path="res://assets/location/decorative_props.png" type="Texture" id=4]
[ext_resource path="res://GOAP.cs" type="Script" id=5]
[ext_resource path="res://goap/planner_manager/PlanManager.tscn" type="PackedScene" id=6]
[ext_resource path="res://goap-demo/key/Key.tscn" type="PackedScene" id=7]
[ext_resource path="res://icon.png" type="Texture" id=8]
[ext_resource path="res://goap-demo/chest/Chest.tscn" type="PackedScene" id=9]

Expand Down Expand Up @@ -149,5 +150,29 @@ position = Vector2( 0.156921, -1.35449 )
scale = Vector2( 0.2, 0.2 )
texture = ExtResource( 8 )

[node name="Key" parent="." instance=ExtResource( 7 )]
modulate = Color( 0.921569, 0.792157, 0.286275, 1 )
position = Vector2( 202.731, 251.607 )

[node name="Key2" parent="." instance=ExtResource( 7 )]
modulate = Color( 0.917647, 0.286275, 0.921569, 1 )
position = Vector2( 201.05, 194.426 )

[node name="Key3" parent="." instance=ExtResource( 7 )]
modulate = Color( 0.286275, 0.921569, 0.298039, 1 )
position = Vector2( 181.709, 314.675 )

[node name="Key4" parent="." instance=ExtResource( 7 )]
modulate = Color( 0.921569, 0.419608, 0.286275, 1 )
position = Vector2( -274.525, 288.455 )

[node name="Key5" parent="." instance=ExtResource( 7 )]
modulate = Color( 0.921569, 0.792157, 0.286275, 1 )
position = Vector2( -186.874, 292.201 )

[node name="Key6" parent="." instance=ExtResource( 7 )]
modulate = Color( 0.286275, 0.847059, 0.921569, 1 )
position = Vector2( -228.827, 290.702 )

[node name="Chest" parent="." instance=ExtResource( 9 )]
position = Vector2( -154.038, 214.593 )
position = Vector2( -155.72, 196.093 )
Binary file added assets/key-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/key-white.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/key-white.png-2b8bb1b5bdc3f1a6eb1d91c5bac5f0d7.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/key-white.png"
dest_files=[ "res://.import/key-white.png-2b8bb1b5bdc3f1a6eb1d91c5bac5f0d7.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
Binary file added assets/key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/key.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/key.png-a97df9ba773df86f934812b8b28ef996.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/key.png"
dest_files=[ "res://.import/key.png-a97df9ba773df86f934812b8b28ef996.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
130 changes: 121 additions & 9 deletions goap-demo/key/Key.tscn
Original file line number Diff line number Diff line change
@@ -1,19 +1,131 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=30 format=2]

[ext_resource path="res://icon.png" type="Texture" id=1]
[ext_resource path="res://assets/key.png" type="Texture" id=1]
[ext_resource path="res://AI/subsystems/item/Item.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/key-white.png" type="Texture" id=3]

[sub_resource type="CircleShape2D" id=1]
[sub_resource type="CircleShape2D" id=14]
radius = 15.0

[sub_resource type="AtlasTexture" id=1]
atlas = ExtResource( 1 )
region = Rect2( 0, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=2]
atlas = ExtResource( 1 )
region = Rect2( 32, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=3]
atlas = ExtResource( 1 )
region = Rect2( 64, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=4]
atlas = ExtResource( 1 )
region = Rect2( 96, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=5]
atlas = ExtResource( 1 )
region = Rect2( 128, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=6]
atlas = ExtResource( 1 )
region = Rect2( 160, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=7]
atlas = ExtResource( 1 )
region = Rect2( 192, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=8]
atlas = ExtResource( 1 )
region = Rect2( 224, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=9]
atlas = ExtResource( 1 )
region = Rect2( 256, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=10]
atlas = ExtResource( 1 )
region = Rect2( 288, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=11]
atlas = ExtResource( 1 )
region = Rect2( 320, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=12]
atlas = ExtResource( 1 )
region = Rect2( 352, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=15]
atlas = ExtResource( 3 )
region = Rect2( 0, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=16]
atlas = ExtResource( 3 )
region = Rect2( 32, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=17]
atlas = ExtResource( 3 )
region = Rect2( 64, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=18]
atlas = ExtResource( 3 )
region = Rect2( 96, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=19]
atlas = ExtResource( 3 )
region = Rect2( 128, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=20]
atlas = ExtResource( 3 )
region = Rect2( 160, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=21]
atlas = ExtResource( 3 )
region = Rect2( 192, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=22]
atlas = ExtResource( 3 )
region = Rect2( 224, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=23]
atlas = ExtResource( 3 )
region = Rect2( 256, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=24]
atlas = ExtResource( 3 )
region = Rect2( 288, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=25]
atlas = ExtResource( 3 )
region = Rect2( 320, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=26]
atlas = ExtResource( 3 )
region = Rect2( 352, 0, 32, 32 )

[sub_resource type="SpriteFrames" id=13]
animations = [ {
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ) ],
"loop": true,
"name": "default",
"speed": 5.0
}, {
"frames": [ SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ), SubResource( 21 ), SubResource( 22 ), SubResource( 23 ), SubResource( 24 ), SubResource( 25 ), SubResource( 26 ) ],
"loop": true,
"name": "white",
"speed": 5.0
} ]

[node name="Key" instance=ExtResource( 2 )]
collision_mask = 2
itemType = 1

[node name="Sprite" type="Sprite" parent="." index="0"]
modulate = Color( 0.694118, 0.945098, 0, 1 )
scale = Vector2( 0.4, 0.4 )
texture = ExtResource( 1 )
[node name="CollisionShape2D" parent="." index="0"]
shape = SubResource( 14 )

[node name="CollisionShape2D" parent="." index="1"]
shape = SubResource( 1 )
[node name="Sprite" type="AnimatedSprite" parent="." index="1"]
frames = SubResource( 13 )
animation = "white"
frame = 10
speed_scale = 1.5
playing = true

0 comments on commit 627f799

Please sign in to comment.