1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-29 11:34:22 +00:00

Tweak Imp and Sheep for initial interactions

This commit is contained in:
Steffo 2024-04-14 23:29:39 +02:00
parent b1ab4cc5c7
commit b58822d26e
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
3 changed files with 58 additions and 1 deletions

12
entities/imp.gd Normal file
View file

@ -0,0 +1,12 @@
extends CharacterBody2D
class_name Imp
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

41
entities/imp.tscn Normal file
View file

@ -0,0 +1,41 @@
[gd_scene load_steps=7 format=3 uid="uid://4d3ksr3171x4"]
[ext_resource type="Script" path="res://entities/imp.gd" id="1_dixpc"]
[ext_resource type="PackedScene" uid="uid://dxmodn8mbvw0i" path="res://behaviours/hunt_target.tscn" id="3_6bq0i"]
[ext_resource type="PackedScene" uid="uid://dijcjahkddudv" path="res://behaviours/draggable.tscn" id="3_4528r"]
[ext_resource type="PackedScene" uid="uid://kceb2v2dm0qn" path="res://behaviours/move_towards_target.tscn" id="4_ofu70"]
[sub_resource type="CircleShape2D" id="CircleShape2D_c5tcn"]
radius = 16.0
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_08frh"]
[node name="Imp" type="CharacterBody2D"]
collision_layer = 8
collision_mask = 14
script = ExtResource("1_dixpc")
[node name="Shape" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_c5tcn")
[node name="Sprite" type="Sprite2D" parent="."]
scale = Vector2(32, 32)
texture = SubResource("PlaceholderTexture2D_08frh")
[node name="Draggable" parent="." instance=ExtResource("3_4528r")]
scale = Vector2(2, 2)
[node name="DragSound" type="AudioStreamPlayer2D" parent="Draggable"]
scale = Vector2(0.5, 0.5)
[node name="DropSound" type="AudioStreamPlayer2D" parent="Draggable"]
scale = Vector2(0.5, 0.5)
[node name="HuntTarget" parent="." instance=ExtResource("3_6bq0i")]
tag = &"Sheep"
[node name="MoveTowardsTarget" parent="." instance=ExtResource("4_ofu70")]
[connection signal="dragged" from="Draggable" to="." method="_on_draggable_dragged"]
[connection signal="dropped" from="Draggable" to="." method="_on_draggable_dropped"]
[connection signal="move" from="Draggable" to="." method="_on_drag_move"]

View file

@ -1,10 +1,11 @@
[gd_scene load_steps=8 format=3 uid="uid://bc2bm8lbol18w"] [gd_scene load_steps=9 format=3 uid="uid://bc2bm8lbol18w"]
[ext_resource type="Script" path="res://entities/sheep.gd" id="1_4dmll"] [ext_resource type="Script" path="res://entities/sheep.gd" id="1_4dmll"]
[ext_resource type="PackedScene" uid="uid://bvrxvrjlo5130" path="res://behaviours/move_towards_mouse.tscn" id="2_tfd2i"] [ext_resource type="PackedScene" uid="uid://bvrxvrjlo5130" path="res://behaviours/move_towards_mouse.tscn" id="2_tfd2i"]
[ext_resource type="PackedScene" uid="uid://dijcjahkddudv" path="res://behaviours/draggable.tscn" id="3_8ku7r"] [ext_resource type="PackedScene" uid="uid://dijcjahkddudv" path="res://behaviours/draggable.tscn" id="3_8ku7r"]
[ext_resource type="AudioStream" uid="uid://buxgivpkh8dyl" path="res://entities/drop.wav" id="4_nxjnl"] [ext_resource type="AudioStream" uid="uid://buxgivpkh8dyl" path="res://entities/drop.wav" id="4_nxjnl"]
[ext_resource type="AudioStream" uid="uid://bmfscpnugaejk" path="res://entities/sheep_drag.wav" id="4_oalqu"] [ext_resource type="AudioStream" uid="uid://bmfscpnugaejk" path="res://entities/sheep_drag.wav" id="4_oalqu"]
[ext_resource type="PackedScene" uid="uid://dfdr3e32lohq" path="res://behaviours/edible.tscn" id="6_3odsh"]
[sub_resource type="CircleShape2D" id="CircleShape2D_c5tcn"] [sub_resource type="CircleShape2D" id="CircleShape2D_c5tcn"]
radius = 16.0 radius = 16.0
@ -39,6 +40,9 @@ stream = ExtResource("4_oalqu")
scale = Vector2(0.5, 0.5) scale = Vector2(0.5, 0.5)
stream = ExtResource("4_nxjnl") stream = ExtResource("4_nxjnl")
[node name="Edible" parent="." instance=ExtResource("6_3odsh")]
tag = &"Sheep"
[connection signal="move" from="MoveTowardsMouse" to="." method="_on_move"] [connection signal="move" from="MoveTowardsMouse" to="." method="_on_move"]
[connection signal="dragged" from="Draggable" to="." method="_on_draggable_dragged"] [connection signal="dragged" from="Draggable" to="." method="_on_draggable_dragged"]
[connection signal="dropped" from="Draggable" to="." method="_on_draggable_dropped"] [connection signal="dropped" from="Draggable" to="." method="_on_draggable_dropped"]