1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-12-01 20:44:21 +00:00
hella-farm/scenes/game/cursor_magnet.tscn
Stefano Pigozzi 3d17dcd3f0
Make Sheeps Draggable with a CursorMagnet
Throwing and drag isn't implemented yet. Any ideas for how to do it with this framework?
Might be a good idea to do it on a branch first...
2024-04-14 07:46:06 +02:00

23 lines
910 B
Text

[gd_scene load_steps=4 format=3 uid="uid://7j1b55t8tafg"]
[ext_resource type="Script" path="res://scenes/game/cursor_magnet.gd" id="1_xk040"]
[ext_resource type="PackedScene" uid="uid://bvrxvrjlo5130" path="res://behaviours/move_towards_mouse.tscn" id="2_ljil3"]
[sub_resource type="CircleShape2D" id="CircleShape2D_6mkjn"]
radius = 16.0
[node name="CursorMagnet" type="Area2D"]
script = ExtResource("1_xk040")
[node name="Shape" type="CollisionShape2D" parent="."]
scale = Vector2(0.5, 0.5)
shape = SubResource("CircleShape2D_6mkjn")
debug_color = Color(1, 1, 1, 0.67451)
[node name="MoveTowardsMouse" parent="." instance=ExtResource("2_ljil3")]
scale = Vector2(10000, 10000)
speed = 100000.0
[connection signal="dragged" from="." to="." method="_on_dragged"]
[connection signal="dropped" from="." to="." method="_on_dropped"]
[connection signal="move" from="MoveTowardsMouse" to="." method="_on_move"]