From c20eb76fb985efcd477de63aacd4e62b5d6ae8f7 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 19 Apr 2024 01:46:25 +0200 Subject: [PATCH] Again, remove `Draggable` from `Imp` --- entities/imp.gd | 12 ++---------- scenes/game/main_game.tscn | 6 +++++- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/entities/imp.gd b/entities/imp.gd index bbbd025..ee93ec7 100644 --- a/entities/imp.gd +++ b/entities/imp.gd @@ -5,7 +5,6 @@ class_name Imp @onready var skull_spawner: Spawner = $"SkullSpawner" @onready var sprite: SpriteLeftRight = $"Sprite" -@onready var draggable: Draggable = $"Draggable" func _on_eat_target_eaten(target: Edible): @@ -13,13 +12,6 @@ func _on_eat_target_eaten(target: Edible): if Random.rng.randf() < skull_chance: skull_spawner.spawn() - -func _on_draggable_move(movement:Vector2): - if draggable.being_dragged: - move_and_collide(movement) - sprite.handle_move(movement) - func _on_move(movement:Vector2): - if not draggable.being_dragged: - move_and_collide(movement) - sprite.handle_move(movement) + move_and_collide(movement) + sprite.handle_move(movement) diff --git a/scenes/game/main_game.tscn b/scenes/game/main_game.tscn index 0fcecdc..6e95fcd 100644 --- a/scenes/game/main_game.tscn +++ b/scenes/game/main_game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=3 uid="uid://cxj5aud02f40j"] +[gd_scene load_steps=10 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"] @@ -6,6 +6,7 @@ [ext_resource type="PackedScene" uid="uid://brvbtvt4em32" path="res://behaviours/counter.tscn" id="3_p6jw3"] [ext_resource type="PackedScene" uid="uid://col1q3elvkfwk" path="res://scenes/game/cursor.tscn" id="5_g504x"] [ext_resource type="PackedScene" uid="uid://bc2bm8lbol18w" path="res://entities/sheep.tscn" id="6_j2kdp"] +[ext_resource type="PackedScene" uid="uid://4d3ksr3171x4" path="res://entities/imp.tscn" id="7_7od2n"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_058kb"] texture = ExtResource("2_o7bg5") @@ -842,3 +843,6 @@ position = Vector2(307, -33) [node name="Sheep5" parent="." instance=ExtResource("6_j2kdp")] position = Vector2(182, -217) + +[node name="Imp" parent="." instance=ExtResource("7_7od2n")] +position = Vector2(-65, -233)