mirror of
https://github.com/Yadciel1/2048-Shooter.git
synced 2025-06-16 11:15:23 +02:00
double click vorbereitung
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user