1
0
Fork 0
mirror of https://github.com/tonytins/dressupzack synced 2025-06-25 16:14:43 -04:00

Tweaked drag and drop script

- Applied new drag & drop architecture to main game scene
This commit is contained in:
Tony Bark 2023-12-09 22:26:27 -05:00
parent 9ff5c5aae3
commit 3097f5063a
9 changed files with 111 additions and 132 deletions

View file

@ -1,14 +1,23 @@
# This project is licensed under the GPL-3.0 license.
# See the LICENSE file in the project root for more information.
@tool
extends Node2D
@export var group: String = "dropable"
@export var texture: Texture2D
var is_draggable = false
var is_inside_dropable = false
var body_ref
var offset: Vector2
@onready var sprite = $Sprite2D
@onready var collsion = $Area2D/CollisionShape2D
func _ready():
sprite.texture = texture
collsion.position = sprite.position
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if is_draggable: