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

View File

@ -90,7 +90,7 @@ tracks/0/keys = {
} }
[sub_resource type="RectangleShape2D" id=4] [sub_resource type="RectangleShape2D" id=4]
extents = Vector2( 12, 12 ) extents = Vector2( 18, 19.625 )
[node name="ShooterObject" type="Node2D"] [node name="ShooterObject" type="Node2D"]
position = Vector2( 64, 64 ) position = Vector2( 64, 64 )
@ -125,6 +125,7 @@ anims/Shoot = SubResource( 3 )
[node name="panzerArea" type="Area2D" parent="." groups=["Panzer"]] [node name="panzerArea" type="Area2D" parent="." groups=["Panzer"]]
[node name="CollisionShape2D" type="CollisionShape2D" parent="panzerArea"] [node name="CollisionShape2D" type="CollisionShape2D" parent="panzerArea"]
position = Vector2( 0, 1.375 )
shape = SubResource( 4 ) shape = SubResource( 4 )
[connection signal="animation_finished" from="Shoot/AnimationPlayer" to="." method="_on_AnimationPlayer_shoot_finished"] [connection signal="animation_finished" from="Shoot/AnimationPlayer" to="." method="_on_AnimationPlayer_shoot_finished"]

View File

@ -31,7 +31,7 @@ config={
"is_test_europe_user_consent": false "is_test_europe_user_consent": false
}, },
"general": { "general": {
"is_enabled": true, "is_enabled": false,
"is_for_child_directed_treatment": false, "is_for_child_directed_treatment": false,
"max_ad_content_rating": "G" "max_ad_content_rating": "G"
}, },
@ -73,10 +73,6 @@ config/name="2048 shooter"
run/main_scene="res://Main Scenes/MainMenu.tscn" run/main_scene="res://Main Scenes/MainMenu.tscn"
config/icon="res://icon.png" config/icon="res://icon.png"
[autoload]
MobileAds="*res://addons/admob/src/singletons/MobileAds.gd"
[display] [display]
window/size/width=576 window/size/width=576
@ -86,10 +82,6 @@ window/size/test_height=900
window/handheld/orientation="portrait" window/handheld/orientation="portrait"
window/stretch/mode="2d" window/stretch/mode="2d"
[editor_plugins]
enabled=PoolStringArray( "res://addons/admob/plugin.cfg" )
[gui] [gui]
common/drop_mouse_on_gui_input_disabled=true common/drop_mouse_on_gui_input_disabled=true