double click vorbereitung

This commit is contained in:
Yadciel
2022-12-05 22:26:26 +01:00
parent 015c1ad0ae
commit ef897f0b1f
3 changed files with 13 additions and 10 deletions

View File

@ -12,6 +12,7 @@ var life = 100
var hover = null
onready var start_panzer = 1
var rng = RandomNumberGenerator.new()
var holding_time = 0
signal speed_shoot
@ -33,6 +34,8 @@ func _process(delta):
if $Panel/Area2D/LifeBar.value == 0:
save_score()
get_tree().change_scene("res://Main Scenes/GameOver.tscn")
if holding_item != null:
holding_time += delta
func slot_gui_input(event: InputEvent, slot: SlotClass):
# if OS.get_name() != "Android":
@ -43,6 +46,13 @@ func slot_gui_input(event: InputEvent, slot: SlotClass):
if event is InputEventScreenTouch:
if event.pressed:
_Panzer_Slot_handler_touch(event, slot)
if holding_item != null and holding_time > 0.2:
#double click action
# holding_item.old_slot.putIntoSlot(holding_item)
# holding_item.old_slot.upgradePanzerInSlot()
# holding_item = null
# holding_time = 0
pass
else:
if holding_item != null and hover == null and holding_item.old_slot != null:
holding_item.old_slot.putIntoSlot(holding_item)