mirror of
https://github.com/Steffo99/hella-farm.git
synced 2024-11-25 17:44:24 +00:00
Merge branch 'main' of https://github.com/Steffo99/ld55
This commit is contained in:
commit
3fc74cf0d9
11 changed files with 51 additions and 1 deletions
|
@ -9,6 +9,8 @@ radius = 16.0
|
||||||
script = ExtResource("1_p0pc3")
|
script = ExtResource("1_p0pc3")
|
||||||
|
|
||||||
[node name="MouseArea" type="Area2D" parent="."]
|
[node name="MouseArea" type="Area2D" parent="."]
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 0
|
||||||
monitorable = false
|
monitorable = false
|
||||||
|
|
||||||
[node name="Shape" type="CollisionShape2D" parent="MouseArea"]
|
[node name="Shape" type="CollisionShape2D" parent="MouseArea"]
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
radius = 8.0
|
radius = 8.0
|
||||||
|
|
||||||
[node name="Draggable" type="Area2D"]
|
[node name="Draggable" type="Area2D"]
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 0
|
||||||
script = ExtResource("1_hdedq")
|
script = ExtResource("1_hdedq")
|
||||||
|
|
||||||
[node name="Shape" type="CollisionShape2D" parent="."]
|
[node name="Shape" type="CollisionShape2D" parent="."]
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
radius = 8.0
|
radius = 8.0
|
||||||
|
|
||||||
[node name="HoverDetector" type="Area2D"]
|
[node name="HoverDetector" type="Area2D"]
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 0
|
||||||
monitorable = false
|
monitorable = false
|
||||||
script = ExtResource("1_51m5p")
|
script = ExtResource("1_51m5p")
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,9 @@ radius = 100.0
|
||||||
script = ExtResource("1_3bmd5")
|
script = ExtResource("1_3bmd5")
|
||||||
|
|
||||||
[node name="DetectionArea" type="Area2D" parent="."]
|
[node name="DetectionArea" type="Area2D" parent="."]
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 24
|
||||||
|
monitorable = false
|
||||||
|
|
||||||
[node name="Shape" type="CollisionShape2D" parent="DetectionArea"]
|
[node name="Shape" type="CollisionShape2D" parent="DetectionArea"]
|
||||||
shape = SubResource("CircleShape2D_kxb8e")
|
shape = SubResource("CircleShape2D_kxb8e")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=3 format=3 uid="uid://c7b4v6h7a3dy6"]
|
[gd_scene load_steps=3 format=3 uid="uid://kceb2v2dm0qn"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://behaviours/move_towards_target.gd" id="1_703gy"]
|
[ext_resource type="Script" path="res://behaviours/move_towards_target.gd" id="1_703gy"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cbg5kgwxusvxf" path="res://behaviours/hover_detector.tscn" id="2_nq6qb"]
|
[ext_resource type="PackedScene" uid="uid://cbg5kgwxusvxf" path="res://behaviours/hover_detector.tscn" id="2_nq6qb"]
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
script = ExtResource("1_703gy")
|
script = ExtResource("1_703gy")
|
||||||
|
|
||||||
[node name="CaptureArea" parent="." instance=ExtResource("2_nq6qb")]
|
[node name="CaptureArea" parent="." instance=ExtResource("2_nq6qb")]
|
||||||
|
collision_mask = 24
|
||||||
|
|
||||||
[connection signal="mouse_entered" from="CaptureArea" to="." method="_on_capture_area_mouse_entered"]
|
[connection signal="mouse_entered" from="CaptureArea" to="." method="_on_capture_area_mouse_entered"]
|
||||||
[connection signal="mouse_exited" from="CaptureArea" to="." method="_on_capture_area_mouse_exited"]
|
[connection signal="mouse_exited" from="CaptureArea" to="." method="_on_capture_area_mouse_exited"]
|
||||||
|
|
18
behaviours/spawner.gd
Normal file
18
behaviours/spawner.gd
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
extends Node2D
|
||||||
|
class_name Spawner
|
||||||
|
|
||||||
|
signal spawned(entity: Node2D)
|
||||||
|
|
||||||
|
@export var scene: PackedScene
|
||||||
|
@export var parent: Node2D
|
||||||
|
|
||||||
|
func spawn():
|
||||||
|
var entity = scene.instantiate()
|
||||||
|
entity.global_scale = global_scale
|
||||||
|
entity.global_position = global_position
|
||||||
|
entity.global_rotation = global_rotation
|
||||||
|
parent.add_child(entity)
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
if parent == null:
|
||||||
|
parent = MainGame.get_ancestor(self).get_node("SpawnedEntities")
|
6
behaviours/spawner.tscn
Normal file
6
behaviours/spawner.tscn
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[gd_scene load_steps=2 format=3 uid="uid://cyrg770fsetyu"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://behaviours/spawner.gd" id="1_b4uk0"]
|
||||||
|
|
||||||
|
[node name="Spawner" type="Node2D"]
|
||||||
|
script = ExtResource("1_b4uk0")
|
|
@ -10,6 +10,8 @@ radius = 16.0
|
||||||
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_08frh"]
|
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_08frh"]
|
||||||
|
|
||||||
[node name="Sheep" type="CharacterBody2D"]
|
[node name="Sheep" type="CharacterBody2D"]
|
||||||
|
collision_layer = 8
|
||||||
|
collision_mask = 14
|
||||||
script = ExtResource("1_4dmll")
|
script = ExtResource("1_4dmll")
|
||||||
|
|
||||||
[node name="Shape" type="CollisionShape2D" parent="."]
|
[node name="Shape" type="CollisionShape2D" parent="."]
|
||||||
|
|
|
@ -33,6 +33,16 @@ main_menu={
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[layer_names]
|
||||||
|
|
||||||
|
2d_physics/layer_1="Unset"
|
||||||
|
2d_physics/layer_2="Tiles"
|
||||||
|
2d_physics/layer_3="Trees"
|
||||||
|
2d_physics/layer_4="Entities (grounded)"
|
||||||
|
2d_physics/layer_5="Entities (air)"
|
||||||
|
2d_physics/layer_6="Pickups"
|
||||||
|
2d_physics/layer_7="System"
|
||||||
|
|
||||||
[physics]
|
[physics]
|
||||||
|
|
||||||
common/physics_ticks_per_second=100
|
common/physics_ticks_per_second=100
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
radius = 16.0
|
radius = 16.0
|
||||||
|
|
||||||
[node name="CursorMagnet" type="Area2D"]
|
[node name="CursorMagnet" type="Area2D"]
|
||||||
|
collision_layer = 64
|
||||||
|
collision_mask = 8
|
||||||
script = ExtResource("1_xk040")
|
script = ExtResource("1_xk040")
|
||||||
|
|
||||||
[node name="Shape" type="CollisionShape2D" parent="."]
|
[node name="Shape" type="CollisionShape2D" parent="."]
|
||||||
|
|
|
@ -66,3 +66,5 @@ position = Vector2(-135, -134)
|
||||||
|
|
||||||
[node name="Sheep2" parent="." instance=ExtResource("5_63bwb")]
|
[node name="Sheep2" parent="." instance=ExtResource("5_63bwb")]
|
||||||
position = Vector2(-462, -77)
|
position = Vector2(-462, -77)
|
||||||
|
|
||||||
|
[node name="SpawnedEntities" type="Node2D" parent="."]
|
||||||
|
|
Loading…
Reference in a new issue