mirror of
https://github.com/Steffo99/hella-farm.git
synced 2024-11-24 00:54:22 +00:00
Add barn
Co-authored-by: Maxim Lobovsky <mex.lobo@mail.ru>
This commit is contained in:
parent
acf96de7fc
commit
31dc930ec1
22 changed files with 809 additions and 2 deletions
|
@ -41,4 +41,5 @@ func spawn():
|
|||
var entity = scene.instantiate()
|
||||
entity.global_position = global_position
|
||||
target.add_child.call_deferred(entity) # Not sure why this is needed.
|
||||
spawned.emit(entity)
|
||||
return entity
|
||||
|
|
33
entities/barn.gd
Normal file
33
entities/barn.gd
Normal file
|
@ -0,0 +1,33 @@
|
|||
extends StaticBody2D
|
||||
class_name Barn
|
||||
|
||||
|
||||
signal coin_inserted
|
||||
|
||||
|
||||
@onready var sheep_spawner: Spawner = %"SheepSpawner"
|
||||
@onready var blocked_tracker: Tracker = %"BlockedTracker"
|
||||
@onready var animator: AnimationPlayer = %"Animator"
|
||||
@onready var game := MainGame.get_via_group(self)
|
||||
|
||||
|
||||
func _on_roof_input(_viewport: Node, event: InputEvent, _shape_idx: int) -> void:
|
||||
var gold_counter = game.inventory.get_counter(&"Gold")
|
||||
if gold_counter.value < 5:
|
||||
return
|
||||
if blocked_tracker.tracking:
|
||||
return
|
||||
if not event is InputEventMouseButton:
|
||||
return
|
||||
if not event.pressed:
|
||||
return
|
||||
gold_counter.decrease(5)
|
||||
animator.play(&"coin")
|
||||
|
||||
func _on_animation_finished(anim_name:StringName) -> void:
|
||||
if anim_name == &"coin":
|
||||
coin_inserted.emit()
|
||||
|
||||
func _on_sheep_spawned(entity: Node2D) -> void:
|
||||
Log.p(self, "%s" % entity)
|
||||
entity.get_node("MovementBarn/BarnPriority").priority_alternative()
|
489
entities/barn.tscn
Normal file
489
entities/barn.tscn
Normal file
|
@ -0,0 +1,489 @@
|
|||
[gd_scene load_steps=20 format=3 uid="uid://cn0p5s44h86px"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bihburr5m7inq" path="res://entities/barn_wall_front.png" id="1_4a825"]
|
||||
[ext_resource type="Script" path="res://entities/barn.gd" id="1_ny8oq"]
|
||||
[ext_resource type="Texture2D" uid="uid://p6vg6dgj4ypb" path="res://entities/barn_wall_back.png" id="2_86ic0"]
|
||||
[ext_resource type="Texture2D" uid="uid://bjg4c6uxwasiw" path="res://entities/barn_roof_front.png" id="3_l2mr8"]
|
||||
[ext_resource type="Texture2D" uid="uid://ch44qud0c5alj" path="res://entities/barn_roof_back.png" id="4_2rw2x"]
|
||||
[ext_resource type="PackedScene" uid="uid://8jkesanu4hrn" path="res://behaviours/tracker.tscn" id="6_x01u8"]
|
||||
[ext_resource type="PackedScene" uid="uid://tx1qi6ahlxjp" path="res://behaviours/spawner.tscn" id="7_07yq6"]
|
||||
[ext_resource type="AudioStream" uid="uid://yxokdio25nm8" path="res://entities/barn_coin_enter.ogg" id="7_ecg3r"]
|
||||
[ext_resource type="PackedScene" uid="uid://bc2bm8lbol18w" path="res://entities/sheep.tscn" id="8_kgtsi"]
|
||||
[ext_resource type="AudioStream" uid="uid://dbj3ctst1tbuo" path="res://entities/barn_coin_drop.ogg" id="8_smljs"]
|
||||
[ext_resource type="Texture2D" uid="uid://bfl0tkg85cvb8" path="res://entities/gold.png" id="9_4flhr"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_p5d5r"]
|
||||
resource_name = "coin"
|
||||
length = 2.0
|
||||
step = 0.13
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Coins/Coin1:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Coins/Coin1:position")
|
||||
tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.52),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0, 56)]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Coins/Coin2:visible")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 0.26),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [false, true]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("Coins/Coin2:position")
|
||||
tracks/3/interp = 2
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0.26, 0.78),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0, 56)]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("Coins/Coin3:visible")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0, 0.52),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [false, true]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("Coins/Coin3:position")
|
||||
tracks/5/interp = 2
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"times": PackedFloat32Array(0.52, 1.04),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0, 56)]
|
||||
}
|
||||
tracks/6/type = "value"
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/path = NodePath("Coins/Coin4:visible")
|
||||
tracks/6/interp = 1
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/keys = {
|
||||
"times": PackedFloat32Array(0, 0.78),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [false, true]
|
||||
}
|
||||
tracks/7/type = "value"
|
||||
tracks/7/imported = false
|
||||
tracks/7/enabled = true
|
||||
tracks/7/path = NodePath("Coins/Coin4:position")
|
||||
tracks/7/interp = 2
|
||||
tracks/7/loop_wrap = true
|
||||
tracks/7/keys = {
|
||||
"times": PackedFloat32Array(0.78, 1.3),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0, 56)]
|
||||
}
|
||||
tracks/8/type = "value"
|
||||
tracks/8/imported = false
|
||||
tracks/8/enabled = true
|
||||
tracks/8/path = NodePath("Coins/Coin5:visible")
|
||||
tracks/8/interp = 1
|
||||
tracks/8/loop_wrap = true
|
||||
tracks/8/keys = {
|
||||
"times": PackedFloat32Array(0, 1.04),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [false, true]
|
||||
}
|
||||
tracks/9/type = "value"
|
||||
tracks/9/imported = false
|
||||
tracks/9/enabled = true
|
||||
tracks/9/path = NodePath("Coins/Coin5:position")
|
||||
tracks/9/interp = 2
|
||||
tracks/9/loop_wrap = true
|
||||
tracks/9/keys = {
|
||||
"times": PackedFloat32Array(1.04, 1.56),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0, 56)]
|
||||
}
|
||||
tracks/10/type = "audio"
|
||||
tracks/10/imported = false
|
||||
tracks/10/enabled = true
|
||||
tracks/10/path = NodePath("Coins/Coin1/Sound1")
|
||||
tracks/10/interp = 1
|
||||
tracks/10/loop_wrap = true
|
||||
tracks/10/keys = {
|
||||
"clips": [{
|
||||
"end_offset": 0.0,
|
||||
"start_offset": 0.0,
|
||||
"stream": ExtResource("7_ecg3r")
|
||||
}, {
|
||||
"end_offset": 0.0,
|
||||
"start_offset": 0.0,
|
||||
"stream": ExtResource("8_smljs")
|
||||
}],
|
||||
"times": PackedFloat32Array(0, 0.52)
|
||||
}
|
||||
tracks/10/use_blend = true
|
||||
tracks/11/type = "audio"
|
||||
tracks/11/imported = false
|
||||
tracks/11/enabled = true
|
||||
tracks/11/path = NodePath("Coins/Coin2/Sound2")
|
||||
tracks/11/interp = 1
|
||||
tracks/11/loop_wrap = true
|
||||
tracks/11/keys = {
|
||||
"clips": [{
|
||||
"end_offset": 0.0,
|
||||
"start_offset": 0.0,
|
||||
"stream": ExtResource("8_smljs")
|
||||
}],
|
||||
"times": PackedFloat32Array(0.78)
|
||||
}
|
||||
tracks/11/use_blend = true
|
||||
tracks/12/type = "audio"
|
||||
tracks/12/imported = false
|
||||
tracks/12/enabled = true
|
||||
tracks/12/path = NodePath("Coins/Coin3/Sound3")
|
||||
tracks/12/interp = 1
|
||||
tracks/12/loop_wrap = true
|
||||
tracks/12/keys = {
|
||||
"clips": [{
|
||||
"end_offset": 0.0,
|
||||
"start_offset": 0.0,
|
||||
"stream": ExtResource("8_smljs")
|
||||
}],
|
||||
"times": PackedFloat32Array(1.04)
|
||||
}
|
||||
tracks/12/use_blend = true
|
||||
tracks/13/type = "audio"
|
||||
tracks/13/imported = false
|
||||
tracks/13/enabled = true
|
||||
tracks/13/path = NodePath("Coins/Coin4/Sound4")
|
||||
tracks/13/interp = 1
|
||||
tracks/13/loop_wrap = true
|
||||
tracks/13/keys = {
|
||||
"clips": [{
|
||||
"end_offset": 0.0,
|
||||
"start_offset": 0.0,
|
||||
"stream": ExtResource("8_smljs")
|
||||
}],
|
||||
"times": PackedFloat32Array(1.3)
|
||||
}
|
||||
tracks/13/use_blend = true
|
||||
tracks/14/type = "audio"
|
||||
tracks/14/imported = false
|
||||
tracks/14/enabled = true
|
||||
tracks/14/path = NodePath("Coins/Coin5/Sound5")
|
||||
tracks/14/interp = 1
|
||||
tracks/14/loop_wrap = true
|
||||
tracks/14/keys = {
|
||||
"clips": [{
|
||||
"end_offset": 0.0,
|
||||
"start_offset": 0.0,
|
||||
"stream": ExtResource("8_smljs")
|
||||
}],
|
||||
"times": PackedFloat32Array(1.56)
|
||||
}
|
||||
tracks/14/use_blend = true
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ofgwt"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Coins/Coin1:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Coins/Coin1:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Coins/Coin2:visible")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("Coins/Coin2:position")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("Coins/Coin3:visible")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("Coins/Coin3:position")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
tracks/6/type = "value"
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/path = NodePath("Coins/Coin4:visible")
|
||||
tracks/6/interp = 1
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/7/type = "value"
|
||||
tracks/7/imported = false
|
||||
tracks/7/enabled = true
|
||||
tracks/7/path = NodePath("Coins/Coin4:position")
|
||||
tracks/7/interp = 1
|
||||
tracks/7/loop_wrap = true
|
||||
tracks/7/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
tracks/8/type = "value"
|
||||
tracks/8/imported = false
|
||||
tracks/8/enabled = true
|
||||
tracks/8/path = NodePath("Coins/Coin5:visible")
|
||||
tracks/8/interp = 1
|
||||
tracks/8/loop_wrap = true
|
||||
tracks/8/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/9/type = "value"
|
||||
tracks/9/imported = false
|
||||
tracks/9/enabled = true
|
||||
tracks/9/path = NodePath("Coins/Coin5:position")
|
||||
tracks/9/interp = 1
|
||||
tracks/9/loop_wrap = true
|
||||
tracks/9/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_vvq7g"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_ofgwt"),
|
||||
"coin": SubResource("Animation_p5d5r")
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7lwl1"]
|
||||
size = Vector2(132, 2)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_l8xvy"]
|
||||
size = Vector2(132, 2)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cpwqc"]
|
||||
size = Vector2(11, 62)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1bxxn"]
|
||||
size = Vector2(140, 38)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0ike4"]
|
||||
size = Vector2(121, 62)
|
||||
|
||||
[node name="Barn" type="StaticBody2D"]
|
||||
collision_layer = 88
|
||||
collision_mask = 4
|
||||
script = ExtResource("1_ny8oq")
|
||||
|
||||
[node name="BarnWallFront" type="Sprite2D" parent="."]
|
||||
position = Vector2(8, -58)
|
||||
scale = Vector2(2, 2)
|
||||
texture = ExtResource("1_4a825")
|
||||
|
||||
[node name="BarnWallBack" type="Sprite2D" parent="."]
|
||||
z_index = -10
|
||||
position = Vector2(8, -58)
|
||||
scale = Vector2(2, 2)
|
||||
texture = ExtResource("2_86ic0")
|
||||
|
||||
[node name="BarnRoofFront" type="Sprite2D" parent="."]
|
||||
position = Vector2(8, -58)
|
||||
scale = Vector2(2, 2)
|
||||
texture = ExtResource("3_l2mr8")
|
||||
|
||||
[node name="BarnRoofBack" type="Sprite2D" parent="."]
|
||||
z_index = -10
|
||||
position = Vector2(8, -58)
|
||||
scale = Vector2(2, 2)
|
||||
texture = ExtResource("4_2rw2x")
|
||||
|
||||
[node name="Coins" type="Node2D" parent="."]
|
||||
clip_children = 1
|
||||
position = Vector2(58, -128)
|
||||
scale = Vector2(2, 2)
|
||||
|
||||
[node name="Coin1" type="Sprite2D" parent="Coins"]
|
||||
visible = false
|
||||
z_index = -5
|
||||
texture = ExtResource("9_4flhr")
|
||||
|
||||
[node name="Sound1" type="AudioStreamPlayer2D" parent="Coins/Coin1"]
|
||||
position = Vector2(-29, 8)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
bus = &"CollectSounds"
|
||||
|
||||
[node name="Coin2" type="Sprite2D" parent="Coins"]
|
||||
visible = false
|
||||
z_index = -5
|
||||
texture = ExtResource("9_4flhr")
|
||||
|
||||
[node name="Sound2" type="AudioStreamPlayer2D" parent="Coins/Coin2"]
|
||||
position = Vector2(-29, 8)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
bus = &"CollectSounds"
|
||||
|
||||
[node name="Coin3" type="Sprite2D" parent="Coins"]
|
||||
visible = false
|
||||
z_index = -5
|
||||
texture = ExtResource("9_4flhr")
|
||||
|
||||
[node name="Sound3" type="AudioStreamPlayer2D" parent="Coins/Coin3"]
|
||||
position = Vector2(-29, 8)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
bus = &"CollectSounds"
|
||||
|
||||
[node name="Coin4" type="Sprite2D" parent="Coins"]
|
||||
visible = false
|
||||
z_index = -5
|
||||
texture = ExtResource("9_4flhr")
|
||||
|
||||
[node name="Sound4" type="AudioStreamPlayer2D" parent="Coins/Coin4"]
|
||||
position = Vector2(-29, 8)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
bus = &"CollectSounds"
|
||||
|
||||
[node name="Coin5" type="Sprite2D" parent="Coins"]
|
||||
visible = false
|
||||
z_index = -5
|
||||
texture = ExtResource("9_4flhr")
|
||||
|
||||
[node name="Sound5" type="AudioStreamPlayer2D" parent="Coins/Coin5"]
|
||||
position = Vector2(-29, 8)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
bus = &"CollectSounds"
|
||||
|
||||
[node name="Animator" type="AnimationPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_vvq7g")
|
||||
}
|
||||
|
||||
[node name="Top" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(32, -63)
|
||||
shape = SubResource("RectangleShape2D_7lwl1")
|
||||
|
||||
[node name="Bottom" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(32, 1)
|
||||
shape = SubResource("RectangleShape2D_l8xvy")
|
||||
|
||||
[node name="Back" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(92.5, -31)
|
||||
shape = SubResource("RectangleShape2D_cpwqc")
|
||||
|
||||
[node name="ClickableArea" type="Area2D" parent="."]
|
||||
collision_layer = 128
|
||||
collision_mask = 128
|
||||
monitorable = false
|
||||
|
||||
[node name="Shape" type="CollisionShape2D" parent="ClickableArea"]
|
||||
position = Vector2(32, -83)
|
||||
shape = SubResource("RectangleShape2D_1bxxn")
|
||||
debug_color = Color(0.584314, 0.380392, 1, 0.243137)
|
||||
|
||||
[node name="BlockedTracker" parent="." instance=ExtResource("6_x01u8")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="Shape" type="CollisionShape2D" parent="BlockedTracker"]
|
||||
position = Vector2(26.5, -31)
|
||||
shape = SubResource("RectangleShape2D_0ike4")
|
||||
debug_color = Color(0.733333, 0.447059, 0.411765, 0.419608)
|
||||
|
||||
[node name="SheepSpawner" parent="." instance=ExtResource("7_07yq6")]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(50, -26)
|
||||
scene = ExtResource("8_kgtsi")
|
||||
|
||||
[connection signal="coin_inserted" from="." to="SheepSpawner" method="spawn"]
|
||||
[connection signal="animation_finished" from="Animator" to="." method="_on_animation_finished"]
|
||||
[connection signal="input_event" from="ClickableArea" to="." method="_on_roof_input"]
|
||||
[connection signal="spawned" from="SheepSpawner" to="." method="_on_sheep_spawned" flags=3]
|
BIN
entities/barn_coin_drop.ogg
(Stored with Git LFS)
Normal file
BIN
entities/barn_coin_drop.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
19
entities/barn_coin_drop.ogg.import
Normal file
19
entities/barn_coin_drop.ogg.import
Normal file
|
@ -0,0 +1,19 @@
|
|||
[remap]
|
||||
|
||||
importer="oggvorbisstr"
|
||||
type="AudioStreamOggVorbis"
|
||||
uid="uid://dbj3ctst1tbuo"
|
||||
path="res://.godot/imported/barn_coin_drop.ogg-e5d1e420062934bce7bd63a7fb3bff3f.oggvorbisstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/barn_coin_drop.ogg"
|
||||
dest_files=["res://.godot/imported/barn_coin_drop.ogg-e5d1e420062934bce7bd63a7fb3bff3f.oggvorbisstr"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
BIN
entities/barn_coin_enter.ogg
(Stored with Git LFS)
Normal file
BIN
entities/barn_coin_enter.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
19
entities/barn_coin_enter.ogg.import
Normal file
19
entities/barn_coin_enter.ogg.import
Normal file
|
@ -0,0 +1,19 @@
|
|||
[remap]
|
||||
|
||||
importer="oggvorbisstr"
|
||||
type="AudioStreamOggVorbis"
|
||||
uid="uid://yxokdio25nm8"
|
||||
path="res://.godot/imported/barn_coin_enter.ogg-1ea34471536d1a5128ad047d684e36dc.oggvorbisstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/barn_coin_enter.ogg"
|
||||
dest_files=["res://.godot/imported/barn_coin_enter.ogg-1ea34471536d1a5128ad047d684e36dc.oggvorbisstr"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
BIN
entities/barn_roof_back.png
(Stored with Git LFS)
Normal file
BIN
entities/barn_roof_back.png
(Stored with Git LFS)
Normal file
Binary file not shown.
34
entities/barn_roof_back.png.import
Normal file
34
entities/barn_roof_back.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ch44qud0c5alj"
|
||||
path="res://.godot/imported/barn_roof_back.png-1d0bbdbc295788fbebb4d99b8b57e599.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/barn_roof_back.png"
|
||||
dest_files=["res://.godot/imported/barn_roof_back.png-1d0bbdbc295788fbebb4d99b8b57e599.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
|
BIN
entities/barn_roof_front.png
(Stored with Git LFS)
Normal file
BIN
entities/barn_roof_front.png
(Stored with Git LFS)
Normal file
Binary file not shown.
34
entities/barn_roof_front.png.import
Normal file
34
entities/barn_roof_front.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bjg4c6uxwasiw"
|
||||
path="res://.godot/imported/barn_roof_front.png-6bfaa976c6093e8a1495a25d59c53cb3.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/barn_roof_front.png"
|
||||
dest_files=["res://.godot/imported/barn_roof_front.png-6bfaa976c6093e8a1495a25d59c53cb3.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
|
BIN
entities/barn_wall_back.png
(Stored with Git LFS)
Normal file
BIN
entities/barn_wall_back.png
(Stored with Git LFS)
Normal file
Binary file not shown.
34
entities/barn_wall_back.png.import
Normal file
34
entities/barn_wall_back.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://p6vg6dgj4ypb"
|
||||
path="res://.godot/imported/barn_wall_back.png-01092625d5133cfc830aa9782f6e193b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/barn_wall_back.png"
|
||||
dest_files=["res://.godot/imported/barn_wall_back.png-01092625d5133cfc830aa9782f6e193b.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
|
BIN
entities/barn_wall_front.png
(Stored with Git LFS)
Normal file
BIN
entities/barn_wall_front.png
(Stored with Git LFS)
Normal file
Binary file not shown.
34
entities/barn_wall_front.png.import
Normal file
34
entities/barn_wall_front.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bihburr5m7inq"
|
||||
path="res://.godot/imported/barn_wall_front.png-00503dbfd427184ab8ac20fd32ede19a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/barn_wall_front.png"
|
||||
dest_files=["res://.godot/imported/barn_wall_front.png-00503dbfd427184ab8ac20fd32ede19a.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
|
|
@ -10,6 +10,8 @@ class_name Chupacabra
|
|||
@onready var movement_wander_tp: TargetPicker = movement_wander.get_node("TrackerMeat/TargetPicker")
|
||||
@onready var animator: AnimationPlayer = %"Animator"
|
||||
@onready var eater: Eater = %"Eater"
|
||||
@onready var tophatter: Eater = %"TopHatter"
|
||||
@onready var monocler: Eater = %"Monocler"
|
||||
|
||||
|
||||
func _on_move(movement: Vector2) -> void:
|
||||
|
@ -22,6 +24,8 @@ func _on_eater_eaten(edible:Edible) -> void:
|
|||
func _on_dragged(_cursor: Cursor) -> void:
|
||||
collision_layer = 16
|
||||
collision_mask = 18
|
||||
tophatter.collision_mask = 16
|
||||
monocler.collision_mask = 16
|
||||
z_index = Enums.ZIndex.EntityAir
|
||||
y_sort_enabled = false
|
||||
eater.collision_mask = 16
|
||||
|
@ -30,6 +34,8 @@ func _on_dragged(_cursor: Cursor) -> void:
|
|||
func _on_fallen() -> void:
|
||||
collision_layer = 8
|
||||
collision_mask = 14
|
||||
tophatter.collision_mask = 8
|
||||
monocler.collision_mask = 8
|
||||
z_index = Enums.ZIndex.EntityGround
|
||||
y_sort_enabled = true
|
||||
eater.collision_mask = 8
|
||||
|
|
|
@ -4,6 +4,8 @@ class_name Cthulhu
|
|||
|
||||
@onready var sprite: SpriteLeftRight = %"Sprite"
|
||||
@onready var animator: AnimationPlayer = %"Animator"
|
||||
@onready var tophatter: Eater = %"TopHatter"
|
||||
@onready var monocler: Eater = %"Monocler"
|
||||
|
||||
func _ready():
|
||||
# Setup index and layers
|
||||
|
@ -16,6 +18,8 @@ func _on_move(movement: Vector2):
|
|||
func _on_dragged(_cursor: Cursor) -> void:
|
||||
collision_layer = 16
|
||||
collision_mask = 18
|
||||
tophatter.collision_mask = 16
|
||||
monocler.collision_mask = 16
|
||||
z_index = Enums.ZIndex.EntityAir
|
||||
y_sort_enabled = false
|
||||
animator.play(&"drag_start")
|
||||
|
@ -23,6 +27,8 @@ func _on_dragged(_cursor: Cursor) -> void:
|
|||
func _on_fallen() -> void:
|
||||
collision_layer = 8
|
||||
collision_mask = 14
|
||||
tophatter.collision_mask = 8
|
||||
monocler.collision_mask = 8
|
||||
z_index = Enums.ZIndex.EntityGround
|
||||
y_sort_enabled = true
|
||||
animator.play(&"RESET")
|
||||
|
|
|
@ -5,6 +5,8 @@ class_name Imp
|
|||
@onready var sprite: SpriteLeftRight = %"Sprite"
|
||||
@onready var eater: Eater = %"Eater"
|
||||
@onready var animator: AnimationPlayer = %"Animator"
|
||||
@onready var tophatter: Eater = %"TopHatter"
|
||||
@onready var monocler: Eater = %"Monocler"
|
||||
|
||||
|
||||
func _ready():
|
||||
|
@ -21,6 +23,8 @@ func _on_eater_eaten(edible: Edible) -> void:
|
|||
func _on_dragged(_cursor: Cursor) -> void:
|
||||
collision_layer = 16
|
||||
collision_mask = 18
|
||||
tophatter.collision_mask = 16
|
||||
monocler.collision_mask = 16
|
||||
z_index = Enums.ZIndex.EntityAir
|
||||
y_sort_enabled = false
|
||||
eater.collision_mask = 16
|
||||
|
@ -29,6 +33,8 @@ func _on_dragged(_cursor: Cursor) -> void:
|
|||
func _on_fallen() -> void:
|
||||
collision_layer = 8
|
||||
collision_mask = 14
|
||||
tophatter.collision_mask = 8
|
||||
monocler.collision_mask = 8
|
||||
z_index = Enums.ZIndex.EntityGround
|
||||
y_sort_enabled = true
|
||||
eater.collision_mask = 8
|
||||
|
|
|
@ -4,6 +4,8 @@ class_name Sheep
|
|||
|
||||
@onready var sprite: SpriteLeftRight = %"Sprite"
|
||||
@onready var animator: AnimationPlayer = %"Animator"
|
||||
@onready var tophatter: Eater = %"TopHatter"
|
||||
@onready var monocler: Eater = %"Monocler"
|
||||
|
||||
|
||||
func _ready():
|
||||
|
@ -17,6 +19,8 @@ func _on_move(movement: Vector2) -> void:
|
|||
func _on_dragged(_cursor: Cursor) -> void:
|
||||
collision_layer = 16
|
||||
collision_mask = 18
|
||||
tophatter.collision_mask = 16
|
||||
monocler.collision_mask = 16
|
||||
z_index = Enums.ZIndex.EntityAir
|
||||
y_sort_enabled = false
|
||||
animator.play(&"drag_start")
|
||||
|
@ -24,6 +28,8 @@ func _on_dragged(_cursor: Cursor) -> void:
|
|||
func _on_fallen() -> void:
|
||||
collision_layer = 8
|
||||
collision_mask = 14
|
||||
tophatter.collision_mask = 8
|
||||
monocler.collision_mask = 8
|
||||
z_index = Enums.ZIndex.EntityGround
|
||||
y_sort_enabled = true
|
||||
animator.play(&"RESET")
|
||||
|
|
|
@ -382,6 +382,18 @@ bus = &"DragSounds"
|
|||
stream = ExtResource("17_8kst2")
|
||||
bus = &"FallSounds"
|
||||
|
||||
[node name="MovementBarn" parent="." instance=ExtResource("10_05kcd")]
|
||||
speed = 66.0
|
||||
direction = Vector2(-1, 0)
|
||||
enabled = false
|
||||
|
||||
[node name="BarnPriority" parent="MovementBarn" instance=ExtResource("11_0jlmk")]
|
||||
alternative_priority = 60
|
||||
|
||||
[node name="ExitedTimer" type="Timer" parent="MovementBarn"]
|
||||
wait_time = 2.0
|
||||
one_shot = true
|
||||
|
||||
[connection signal="eaten" from="Sprite/TopHatter" to="." method="_on_eater_eaten"]
|
||||
[connection signal="eaten" from="Sprite/TopHatter" to="Sprite/TopHatter/Spawner" method="enable" unbinds=1]
|
||||
[connection signal="goal_reached" from="Sprite/TopHatter" to="Sprite/TopHatter/Sprite" method="show"]
|
||||
|
@ -431,3 +443,7 @@ bus = &"FallSounds"
|
|||
[connection signal="move_enabled" from="MovementDrag" to="MovementWander" method="clear_direction"]
|
||||
[connection signal="dragged" from="MovementDrag/Draggable" to="MovementDrag" method="drag"]
|
||||
[connection signal="dropped" from="MovementDrag/Draggable" to="MovementDrag" method="drop"]
|
||||
[connection signal="move" from="MovementBarn" to="." method="_on_move"]
|
||||
[connection signal="move_disabled" from="MovementBarn" to="MovementBarn/ExitedTimer" method="stop"]
|
||||
[connection signal="move_enabled" from="MovementBarn" to="MovementBarn/ExitedTimer" method="start"]
|
||||
[connection signal="timeout" from="MovementBarn/ExitedTimer" to="MovementBarn/BarnPriority" method="priority_default"]
|
||||
|
|
|
@ -71,6 +71,18 @@ tracks/2/keys = {
|
|||
"update": 1,
|
||||
"values": [ExtResource("3_k8fgk")]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("Sprite:position")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_5yt72"]
|
||||
resource_name = "drag_loop"
|
||||
|
@ -169,6 +181,42 @@ tracks/0/keys = {
|
|||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0, -6), Vector2(0, 6), Vector2(0, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite:left_texture")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [ExtResource("2_32yw7")]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Sprite:right_texture")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [ExtResource("3_k8fgk")]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("Sprite:scale")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(2, 2)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_yam4u"]
|
||||
_data = {
|
||||
|
@ -198,7 +246,6 @@ script = ExtResource("1_brahc")
|
|||
|
||||
[node name="Sprite" parent="." instance=ExtResource("1_thu73")]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, -3.044)
|
||||
scale = Vector2(2, 2)
|
||||
texture = ExtResource("2_32yw7")
|
||||
left_texture = ExtResource("2_32yw7")
|
||||
|
@ -399,6 +446,7 @@ bus = &"KillSounds"
|
|||
[connection signal="fallen" from="MovementDrag" to="MovementDrag/DragPriority" method="priority_default"]
|
||||
[connection signal="fallen" from="MovementDrag" to="MovementDrag/FallSound" method="play"]
|
||||
[connection signal="move" from="MovementDrag" to="." method="_on_move"]
|
||||
[connection signal="move_enabled" from="MovementDrag" to="Animator" method="play" binds= [&"drag_start"]]
|
||||
[connection signal="dragged" from="MovementDrag/Draggable" to="MovementDrag" method="drag"]
|
||||
[connection signal="dropped" from="MovementDrag/Draggable" to="MovementDrag" method="drop"]
|
||||
[connection signal="eaten" from="Eater" to="." method="_on_eater_eaten"]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=26 format=3 uid="uid://cxj5aud02f40j"]
|
||||
[gd_scene load_steps=27 format=3 uid="uid://cxj5aud02f40j"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/game/main_game.gd" id="1_wiglu"]
|
||||
[ext_resource type="PackedScene" uid="uid://dm068vaseh45n" path="res://scenes/game/game_camera.tscn" id="2_db5xs"]
|
||||
|
@ -19,6 +19,7 @@
|
|||
[ext_resource type="PackedScene" uid="uid://gl4umoff474y" path="res://entities/cthulhu.tscn" id="15_k41qf"]
|
||||
[ext_resource type="PackedScene" uid="uid://cgpwig0rd08vh" path="res://entities/summoning_circle_pentagram.tscn" id="16_nhsrb"]
|
||||
[ext_resource type="PackedScene" uid="uid://db246fkcf452d" path="res://entities/tree.tscn" id="18_r8twr"]
|
||||
[ext_resource type="PackedScene" uid="uid://cn0p5s44h86px" path="res://entities/barn.tscn" id="20_tek4w"]
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_058kb"]
|
||||
texture = ExtResource("2_o7bg5")
|
||||
|
@ -988,4 +989,7 @@ position = Vector2(341, 247)
|
|||
[node name="Tree5" parent="." instance=ExtResource("18_r8twr")]
|
||||
position = Vector2(379, 292)
|
||||
|
||||
[node name="Barn" parent="." instance=ExtResource("20_tek4w")]
|
||||
position = Vector2(472, -245)
|
||||
|
||||
[connection signal="recipe_matched" from="SummoningCirclePentagram" to="." method="_on_recipe_matched"]
|
||||
|
|
Loading…
Reference in a new issue