From ef897f0b1f0377a49adb95dc7c07f53e214342e0 Mon Sep 17 00:00:00 2001 From: Yadciel Date: Mon, 5 Dec 2022 22:26:26 +0100 Subject: [PATCH] double click vorbereitung --- Main Scenes/Game.gd | 10 ++++++++++ Objects/Panzer.tscn | 3 ++- project.godot | 10 +--------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Main Scenes/Game.gd b/Main Scenes/Game.gd index 35ecf57..f01edb8 100644 --- a/Main Scenes/Game.gd +++ b/Main Scenes/Game.gd @@ -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) diff --git a/Objects/Panzer.tscn b/Objects/Panzer.tscn index 21a245d..fade44b 100644 --- a/Objects/Panzer.tscn +++ b/Objects/Panzer.tscn @@ -90,7 +90,7 @@ tracks/0/keys = { } [sub_resource type="RectangleShape2D" id=4] -extents = Vector2( 12, 12 ) +extents = Vector2( 18, 19.625 ) [node name="ShooterObject" type="Node2D"] position = Vector2( 64, 64 ) @@ -125,6 +125,7 @@ anims/Shoot = SubResource( 3 ) [node name="panzerArea" type="Area2D" parent="." groups=["Panzer"]] [node name="CollisionShape2D" type="CollisionShape2D" parent="panzerArea"] +position = Vector2( 0, 1.375 ) shape = SubResource( 4 ) [connection signal="animation_finished" from="Shoot/AnimationPlayer" to="." method="_on_AnimationPlayer_shoot_finished"] diff --git a/project.godot b/project.godot index 100815e..8ba5c27 100644 --- a/project.godot +++ b/project.godot @@ -31,7 +31,7 @@ config={ "is_test_europe_user_consent": false }, "general": { -"is_enabled": true, +"is_enabled": false, "is_for_child_directed_treatment": false, "max_ad_content_rating": "G" }, @@ -73,10 +73,6 @@ config/name="2048 shooter" run/main_scene="res://Main Scenes/MainMenu.tscn" config/icon="res://icon.png" -[autoload] - -MobileAds="*res://addons/admob/src/singletons/MobileAds.gd" - [display] window/size/width=576 @@ -86,10 +82,6 @@ window/size/test_height=900 window/handheld/orientation="portrait" window/stretch/mode="2d" -[editor_plugins] - -enabled=PoolStringArray( "res://addons/admob/plugin.cfg" ) - [gui] common/drop_mouse_on_gui_input_disabled=true