feat: Implement initial main scene with player input management and touch controls, including new graphics assets.
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://biun2yvglxgij"
|
||||
path="res://.godot/imported/grab_tekton.png-38105d2382c7af6ceba9f67fafd9b104.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/touch_control/grab_tekton.png"
|
||||
dest_files=["res://.godot/imported/grab_tekton.png-38105d2382c7af6ceba9f67fafd9b104.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cdwk17moidkj2"
|
||||
path="res://.godot/imported/knock_tekton.png-276cbbff0409c6bfcebf7936bc616b79.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/touch_control/knock_tekton.png"
|
||||
dest_files=["res://.godot/imported/knock_tekton.png-276cbbff0409c6bfcebf7936bc616b79.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
+25
-4
@@ -32,6 +32,8 @@
|
||||
[ext_resource type="Texture2D" uid="uid://3up2su2e0lfa" path="res://assets/graphics/touch_control/freeze_area.png" id="28_fv21b"]
|
||||
[ext_resource type="Texture2D" uid="uid://ckhdyxnho6sjp" path="res://assets/graphics/touch_control/spawn_tile.png" id="28_j8jky"]
|
||||
[ext_resource type="Texture2D" uid="uid://b2vhatfmufn3d" path="res://assets/graphics/touch_control/ghost.png" id="33_5q0nq"]
|
||||
[ext_resource type="Texture2D" uid="uid://cdwk17moidkj2" path="res://assets/graphics/touch_control/knock_tekton.png" id="35_fuf3a"]
|
||||
[ext_resource type="Texture2D" uid="uid://biun2yvglxgij" path="res://assets/graphics/touch_control/grab_tekton.png" id="36_pibwh"]
|
||||
[ext_resource type="Script" uid="uid://86ikh0wuqk7v" path="res://scripts/ui/powerup_inventory_ui.gd" id="powerup_ui_script"]
|
||||
[ext_resource type="Script" uid="uid://b54tfa0n6kogi" path="res://scripts/managers/touch_controls.gd" id="touch_manager"]
|
||||
[ext_resource type="Script" uid="uid://djiml4sh61dc1" path="res://scripts/ui/virtual_joystick.gd" id="virtual_joystick"]
|
||||
@@ -1066,6 +1068,7 @@ theme_override_font_sizes/font_size = 32
|
||||
text = "X0"
|
||||
|
||||
[node name="StopTimer" type="PanelContainer" parent="." unique_id=991540081]
|
||||
visible = false
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
@@ -9768,10 +9771,10 @@ script = ExtResource("virtual_joystick")
|
||||
|
||||
[node name="ActionsBtn" type="VBoxContainer" parent="TouchControls/TouchControls" unique_id=278736451]
|
||||
layout_mode = 0
|
||||
offset_left = 48.0
|
||||
offset_top = 106.00001
|
||||
offset_right = 119.80914
|
||||
offset_bottom = 309.7852
|
||||
offset_left = 48.000004
|
||||
offset_top = 82.00001
|
||||
offset_right = 114.71878
|
||||
offset_bottom = 350.68915
|
||||
rotation = -0.10297442
|
||||
theme_override_constants/separation = 15
|
||||
|
||||
@@ -9805,6 +9808,24 @@ flat = true
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="TektonKnockBtn" type="Button" parent="TouchControls/TouchControls/ActionsBtn" unique_id=2133168886]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
icon = ExtResource("35_fuf3a")
|
||||
flat = true
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="TektonThrowBtn" type="Button" parent="TouchControls/TouchControls/ActionsBtn" unique_id=2097928368]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
icon = ExtResource("36_pibwh")
|
||||
flat = true
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="GrabBtn" type="Button" parent="TouchControls/TouchControls/ActionsBtn" unique_id=914810452]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
@@ -131,14 +131,19 @@ func handle_unhandled_input(event):
|
||||
player.powerup_manager.use_special_effect()
|
||||
KEY_G:
|
||||
if player.is_carrying_tekton:
|
||||
player.throw_tekton()
|
||||
if player.powerup_manager and player.powerup_manager.can_use_special():
|
||||
player.throw_tekton()
|
||||
player.powerup_manager.reset_boost()
|
||||
else:
|
||||
player.grab_tekton()
|
||||
KEY_B:
|
||||
if player.has_method("enter_knock_mode"):
|
||||
player.enter_knock_mode()
|
||||
else:
|
||||
player.knock_tekton()
|
||||
if player.powerup_manager and player.powerup_manager.can_use_special():
|
||||
if player.has_method("enter_knock_mode"):
|
||||
player.enter_knock_mode()
|
||||
player.powerup_manager.reset_boost()
|
||||
else:
|
||||
player.knock_tekton()
|
||||
player.powerup_manager.reset_boost()
|
||||
|
||||
# Handle spawn point selection if not yet selected
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ var put_button: Button
|
||||
var attack_mode_button: Button # Renamed from special_button
|
||||
var spawn_boost_button: Button
|
||||
var settings_button: Button
|
||||
var tekton_knock_button: Button
|
||||
var tekton_throw_button: Button
|
||||
|
||||
# Settings - persisted to config file
|
||||
const CONFIG_PATH = "user://touch_controls_settings.cfg"
|
||||
@@ -131,10 +133,15 @@ func _create_touch_ui():
|
||||
grab_button = _find_or_create_action_button(actions_container, "Grab", "👋", button_positions.grab)
|
||||
put_button = _find_or_create_action_button(actions_container, "Put", "📦", button_positions.put)
|
||||
|
||||
tekton_knock_button = _find_or_create_action_button(actions_container, "TektonKnock", "👊", Vector2(-280, -160))
|
||||
tekton_throw_button = _find_or_create_action_button(actions_container, "TektonThrow", "🎯", Vector2(-280, -80))
|
||||
|
||||
# Order: AttackMode, SpawnBoost, Grab
|
||||
if attack_mode_button: actions_container.move_child(attack_mode_button, 0)
|
||||
if spawn_boost_button: actions_container.move_child(spawn_boost_button, 1)
|
||||
if grab_button: actions_container.move_child(grab_button, 2)
|
||||
if tekton_knock_button: actions_container.move_child(tekton_knock_button, 3)
|
||||
if tekton_throw_button: actions_container.move_child(tekton_throw_button, 4)
|
||||
|
||||
# Hide Put Button
|
||||
if put_button:
|
||||
@@ -252,15 +259,24 @@ func _ensure_shortcut_label(btn: Button, button_name: String):
|
||||
"Put": existing_lbl.text = ""
|
||||
"AttackMode": existing_lbl.text = "Q" if is_sng else ""
|
||||
"SpawnBoost": existing_lbl.text = "E" if is_sng else ""
|
||||
"TektonKnock": existing_lbl.text = "B"
|
||||
"TektonThrow": existing_lbl.text = "G"
|
||||
|
||||
# Ensure correct placement (Top Right)
|
||||
existing_lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
|
||||
existing_lbl.vertical_alignment = VERTICAL_ALIGNMENT_TOP
|
||||
existing_lbl.offset_top = -5 # Closer to top
|
||||
existing_lbl.offset_right = 0 # Aligned with right edge
|
||||
return
|
||||
|
||||
# Add Keyboard Shortcut Label
|
||||
var shortcut_lbl = Label.new()
|
||||
shortcut_lbl.name = "ShortcutLabel"
|
||||
shortcut_lbl.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
shortcut_lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
shortcut_lbl.vertical_alignment = VERTICAL_ALIGNMENT_BOTTOM
|
||||
shortcut_lbl.offset_bottom = 20 # Below button
|
||||
shortcut_lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
|
||||
shortcut_lbl.vertical_alignment = VERTICAL_ALIGNMENT_TOP
|
||||
shortcut_lbl.offset_top = -5 # Closer to top
|
||||
shortcut_lbl.offset_right = 0 # Aligned with right edge
|
||||
shortcut_lbl.add_theme_font_size_override("font_size", 16)
|
||||
shortcut_lbl.add_theme_color_override("font_outline_color", Color.BLACK)
|
||||
shortcut_lbl.add_theme_constant_override("outline_size", 4)
|
||||
@@ -270,6 +286,8 @@ func _ensure_shortcut_label(btn: Button, button_name: String):
|
||||
"Put": shortcut_lbl.text = "" # Disabled shortcut
|
||||
"AttackMode": shortcut_lbl.text = "Q"
|
||||
"SpawnBoost": shortcut_lbl.text = "E"
|
||||
"TektonKnock": shortcut_lbl.text = "B"
|
||||
"TektonThrow": shortcut_lbl.text = "G"
|
||||
|
||||
btn.add_child(shortcut_lbl)
|
||||
|
||||
@@ -289,6 +307,8 @@ func _on_button_pressed(button_name: String):
|
||||
"Put": btn = put_button
|
||||
"AttackMode": btn = attack_mode_button
|
||||
"SpawnBoost": btn = spawn_boost_button
|
||||
"TektonKnock": btn = tekton_knock_button
|
||||
"TektonThrow": btn = tekton_throw_button
|
||||
|
||||
if btn:
|
||||
var tween = create_tween()
|
||||
@@ -305,11 +325,9 @@ func _on_button_pressed(button_name: String):
|
||||
if local_player.has_method("auto_put_item"):
|
||||
local_player.auto_put_item()
|
||||
"AttackMode":
|
||||
emit_signal("attack_mode_pressed") # Also special?
|
||||
# emit_signal("special_pressed") # Keep legacy signal?
|
||||
emit_signal("attack_mode_pressed")
|
||||
var powerup_mgr = local_player.get_node_or_null("PowerUpManager")
|
||||
if powerup_mgr:
|
||||
# Require Full Boost to Activate (User Request: "Connect to boost bar")
|
||||
var can_use = powerup_mgr.can_use_special()
|
||||
var boost_val = powerup_mgr.current_boost
|
||||
print("[TouchControls] AttackMode Pressed. Boost: %s, CanUse: %s" % [boost_val, can_use])
|
||||
@@ -317,24 +335,30 @@ func _on_button_pressed(button_name: String):
|
||||
if can_use:
|
||||
powerup_mgr.use_special_effect() # Sets is_attack_mode=true
|
||||
else:
|
||||
# Optional feedback for not ready?
|
||||
pass
|
||||
else:
|
||||
print("[TouchControls] PowerUpManager missing on player")
|
||||
"SpawnBoost":
|
||||
var powerup_mgr = local_player.get_node_or_null("PowerUpManager")
|
||||
if powerup_mgr:
|
||||
var can_use = powerup_mgr.can_use_special()
|
||||
var boost_val = powerup_mgr.current_boost
|
||||
print("[TouchControls] SpawnBoost Pressed. Boost: %s, CanUse: %s" % [boost_val, can_use])
|
||||
|
||||
if can_use: # Check if boost is full
|
||||
# Same usage logic, but specific action
|
||||
if local_player.special_tiles_manager and local_player.special_tiles_manager.has_method("spawn_powerups_around"):
|
||||
local_player.special_tiles_manager.spawn_powerups_around(local_player.current_position)
|
||||
powerup_mgr.reset_boost() # Consume the boost manually
|
||||
else:
|
||||
print("[TouchControls] PowerUpManager missing on player")
|
||||
if powerup_mgr and powerup_mgr.can_use_special():
|
||||
if local_player.special_tiles_manager and local_player.special_tiles_manager.has_method("spawn_powerups_around"):
|
||||
local_player.special_tiles_manager.spawn_powerups_around(local_player.current_position)
|
||||
powerup_mgr.reset_boost()
|
||||
"TektonKnock":
|
||||
var powerup_mgr = local_player.get_node_or_null("PowerUpManager")
|
||||
if powerup_mgr and powerup_mgr.can_use_special():
|
||||
if local_player.has_method("enter_knock_mode"):
|
||||
local_player.enter_knock_mode()
|
||||
powerup_mgr.reset_boost()
|
||||
elif local_player.has_method("knock_tekton"):
|
||||
local_player.knock_tekton()
|
||||
powerup_mgr.reset_boost()
|
||||
"TektonThrow":
|
||||
var powerup_mgr = local_player.get_node_or_null("PowerUpManager")
|
||||
if powerup_mgr and powerup_mgr.can_use_special():
|
||||
if local_player.has_method("throw_tekton"):
|
||||
local_player.throw_tekton()
|
||||
powerup_mgr.reset_boost()
|
||||
|
||||
func _on_button_released(button_name: String):
|
||||
var btn: Button
|
||||
@@ -343,6 +367,8 @@ func _on_button_released(button_name: String):
|
||||
"Put": btn = put_button
|
||||
"AttackMode": btn = attack_mode_button
|
||||
"SpawnBoost": btn = spawn_boost_button
|
||||
"TektonKnock": btn = tekton_knock_button
|
||||
"TektonThrow": btn = tekton_throw_button
|
||||
|
||||
if btn:
|
||||
var tween = create_tween()
|
||||
@@ -512,6 +538,8 @@ func _on_boost_points_changed(current_points: int, max_points: int):
|
||||
|
||||
_update_boost_button_state(attack_mode_button, is_full)
|
||||
_update_boost_button_state(spawn_boost_button, is_full)
|
||||
_update_boost_button_state(tekton_knock_button, is_full)
|
||||
_update_boost_button_state(tekton_throw_button, is_full)
|
||||
|
||||
func _update_boost_button_state(btn: Button, is_enabled: bool):
|
||||
if not btn: return
|
||||
|
||||
Reference in New Issue
Block a user