initial
This commit is contained in:
48
scenes/farmhouse/farmhouse.gd
Normal file
48
scenes/farmhouse/farmhouse.gd
Normal file
@@ -0,0 +1,48 @@
|
||||
extends Scene
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
signal entered_from_pasture
|
||||
|
||||
var target: Vector2
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
super()
|
||||
|
||||
pass # Replace with function body.
|
||||
|
||||
func _process(delta):
|
||||
super(delta)
|
||||
#var cam = get_viewport().get_camera_2d()
|
||||
#if target:
|
||||
#
|
||||
#cam.global_position = $SetPiece/thingpoint.global_position #+= ($SetPiece/thingpoint.global_position - cam.global_position).normalized() * 5000.0 * delta
|
||||
#cam.zoom = lerp(cam.zoom, Vector2(1.5, 1.5), 1.15 * delta)
|
||||
#else:
|
||||
#cam.position=Vector2(0,0)
|
||||
#super(delta)
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
#func _process(delta):
|
||||
# pass
|
||||
|
||||
var pasture = preload("res://scenes/healer_pasture/healer_pasture.tscn")
|
||||
|
||||
func _on_pasture_exit_interacted():
|
||||
var path = NavigationServer2D.map_get_path(self.map, self.pathfind.to_local(self.ego.global_position), pathfind.to_local($"pasture-exit-point".global_position), true)
|
||||
start_main_script(ScriptBuilder.init(ScriptBuilder.walk_path(self.ego, path))
|
||||
.and_then(ScriptBuilder.transition(self, pasture, "healers-exit-point"))
|
||||
.and_then(ScriptBuilder.walk_to_deferred("healers-exit-point", "healers-entrance-point"))
|
||||
.can_interrupt().build(self, "_on_script_complete"))
|
||||
|
||||
func _on_entered_from_pasture():
|
||||
print("HERRREERERE")
|
||||
|
||||
func _on_set_piece_interacted():
|
||||
target = $SetPiece/thingpoint.global_position
|
||||
$AnimationPlayer.play("focus_thing")
|
||||
BIN
scenes/farmhouse/farmhouse.png
LFS
Normal file
BIN
scenes/farmhouse/farmhouse.png
LFS
Normal file
Binary file not shown.
34
scenes/farmhouse/farmhouse.png.import
Normal file
34
scenes/farmhouse/farmhouse.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bb3obkm5vbks4"
|
||||
path="res://.godot/imported/farmhouse.png-ca6fd2f76504bacbad031fa9b2d59cfe.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scenes/farmhouse/farmhouse.png"
|
||||
dest_files=["res://.godot/imported/farmhouse.png-ca6fd2f76504bacbad031fa9b2d59cfe.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
57
scenes/farmhouse/farmhouse.tscn
Normal file
57
scenes/farmhouse/farmhouse.tscn
Normal file
@@ -0,0 +1,57 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://mlev7lxrmpb1"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/farmhouse/farmhouse.gd" id="1"]
|
||||
[ext_resource type="Script" path="res://SetPiece_.gd" id="2"]
|
||||
[ext_resource type="Script" path="res://ScalePoint_.gd" id="3"]
|
||||
[ext_resource type="Texture2D" uid="uid://ctdmdrk6tmj2h" path="res://scenes/mountain_house/bg.png" id="4_b6gul"]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id="NavigationPolygon_dvbx8"]
|
||||
vertices = PackedVector2Array(1329, 1104, 425, 1065, 426, 1065, 1830, 1062, 356, 1047, 607, 909, 1469, 852, 1875, 983)
|
||||
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2), PackedInt32Array(3, 0, 2, 4, 5, 6, 7)])
|
||||
outlines = Array[PackedVector2Array]([PackedVector2Array(604, 900, 329, 1051, 424, 1075, 1330, 1115, 1837, 1072, 1891, 977, 1472, 842)])
|
||||
source_geometry_group_name = &"navigation_polygon_source_group"
|
||||
|
||||
[node name="background" type="Node2D"]
|
||||
position = Vector2(0, -4)
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="pasture-exit-point" type="Node2D" parent="."]
|
||||
position = Vector2(987, 1072)
|
||||
|
||||
[node name="pasture-exit" type="Polygon2D" parent="." groups=["set-piece"]]
|
||||
position = Vector2(-404, -1101)
|
||||
color = Color(1, 1, 1, 0.262745)
|
||||
polygon = PackedVector2Array(1152, 2147, 870, 2239, 634, 2309, 1881, 2362, 1720, 2157)
|
||||
script = ExtResource("2")
|
||||
label = "To pasture"
|
||||
|
||||
[node name="entrance-exit" type="Polygon2D" parent="." groups=["set-piece"]]
|
||||
position = Vector2(78, -414)
|
||||
color = Color(1, 1, 1, 0.262745)
|
||||
polygon = PackedVector2Array(3252, 1172, 2984, 1324, 2980, 1452, 3060, 1732, 3344, 1704)
|
||||
script = ExtResource("2")
|
||||
label = "open door"
|
||||
|
||||
[node name="StartScalePoint" type="Node2D" parent="."]
|
||||
position = Vector2(1493, 823)
|
||||
script = ExtResource("3")
|
||||
target_scale = 0.2
|
||||
|
||||
[node name="EndScalePoint" type="Node2D" parent="."]
|
||||
position = Vector2(1714, 1134)
|
||||
scale = Vector2(0.44, 0.44)
|
||||
script = ExtResource("3")
|
||||
target_scale = 0.55
|
||||
|
||||
[node name="entrance-exit-point" type="Node2D" parent="."]
|
||||
position = Vector2(1056, 1066)
|
||||
|
||||
[node name="bg" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("4_b6gul")
|
||||
centered = false
|
||||
|
||||
[node name="pathfind" type="NavigationRegion2D" parent="."]
|
||||
navigation_polygon = SubResource("NavigationPolygon_dvbx8")
|
||||
|
||||
[connection signal="interacted" from="pasture-exit" to="." method="_on_pasture_exit_interacted"]
|
||||
[connection signal="interacted" from="entrance-exit" to="." method="_on_entranceexit_interacted"]
|
||||
Reference in New Issue
Block a user