menu interactive, refactor, perf tests, charge bar, debug menu stuff
This commit is contained in:
+55
-4
@@ -1,19 +1,57 @@
|
||||
extends Control
|
||||
|
||||
## Intro menu: Siim's arena mockup as a looping video background with an
|
||||
## overlaid Play / Options / Credits / Exit UI positioned over his sketch.
|
||||
## Play fades to black and loads the game; Options rebinds controls.
|
||||
## Intro menu: Siim's arena animation as a looping video background.
|
||||
## Play / Options / Credits / Exit UI are overlaid; Play follows the cape.
|
||||
|
||||
const GAME_SCENE := "res://scene.tscn"
|
||||
const FADE_TIME := 0.6
|
||||
|
||||
## Cape centroid per frame (normalized 0-1), detected from red-pixel centroid.
|
||||
## 34 frames at 24 fps = 1.4167 s loop.
|
||||
const VIDEO_FPS := 24.0
|
||||
const CAPE_POS: Array = [
|
||||
Vector2(0.4530, 0.6513),
|
||||
Vector2(0.4521, 0.6516),
|
||||
Vector2(0.4495, 0.6524),
|
||||
Vector2(0.4456, 0.6537),
|
||||
Vector2(0.4415, 0.6550),
|
||||
Vector2(0.4373, 0.6578),
|
||||
Vector2(0.4338, 0.6616),
|
||||
Vector2(0.4306, 0.6669),
|
||||
Vector2(0.4273, 0.6673),
|
||||
Vector2(0.4256, 0.6586),
|
||||
Vector2(0.4258, 0.6428),
|
||||
Vector2(0.4281, 0.6243),
|
||||
Vector2(0.4324, 0.6086),
|
||||
Vector2(0.4382, 0.5997),
|
||||
Vector2(0.4439, 0.5972),
|
||||
Vector2(0.4483, 0.5970),
|
||||
Vector2(0.4512, 0.5986),
|
||||
Vector2(0.4529, 0.6025),
|
||||
Vector2(0.4535, 0.6078),
|
||||
Vector2(0.4533, 0.6135),
|
||||
Vector2(0.4539, 0.6159),
|
||||
Vector2(0.4545, 0.6120),
|
||||
Vector2(0.4546, 0.6050),
|
||||
Vector2(0.4541, 0.5988),
|
||||
Vector2(0.4528, 0.5961),
|
||||
Vector2(0.4508, 0.6012),
|
||||
Vector2(0.4485, 0.6123),
|
||||
Vector2(0.4466, 0.6256),
|
||||
Vector2(0.4456, 0.6388),
|
||||
Vector2(0.4457, 0.6491),
|
||||
Vector2(0.4473, 0.6552),
|
||||
Vector2(0.4492, 0.6567),
|
||||
Vector2(0.4513, 0.6556),
|
||||
Vector2(0.4524, 0.6526),
|
||||
]
|
||||
|
||||
## Friendly labels for the rebindable actions (order defines list order).
|
||||
const ACTION_LABELS: Dictionary = {
|
||||
&"move_forward": "Move Forward",
|
||||
&"move_back": "Move Back",
|
||||
&"move_left": "Move Left",
|
||||
&"move_right": "Move Right",
|
||||
&"charge": "Charge",
|
||||
&"ability_kick": "Kick",
|
||||
&"ability_slam": "Slam",
|
||||
&"ability_dash": "Dash",
|
||||
@@ -55,6 +93,19 @@ func _ready() -> void:
|
||||
play_button.grab_focus()
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if not main_panel.visible or video.stream == null:
|
||||
return
|
||||
var frame_count := CAPE_POS.size()
|
||||
var t := video.stream_position
|
||||
var frame_idx := int(t * VIDEO_FPS) % frame_count
|
||||
var cape: Vector2 = CAPE_POS[frame_idx]
|
||||
play_button.anchor_left = cape.x
|
||||
play_button.anchor_right = cape.x
|
||||
play_button.anchor_top = cape.y
|
||||
play_button.anchor_bottom = cape.y
|
||||
|
||||
|
||||
func _build_rebind_rows() -> void:
|
||||
for child in rebind_list.get_children():
|
||||
child.queue_free()
|
||||
|
||||
Reference in New Issue
Block a user