feat: Implement core game managers, player movement logic, and initial UI scenes.
This commit is contained in:
@@ -20,6 +20,7 @@ var arrange_button
|
||||
var playerboard_ui
|
||||
|
||||
var local_player_character
|
||||
var _previous_playerboard_state: Array = []
|
||||
|
||||
enum ActionState {
|
||||
NONE,
|
||||
@@ -122,9 +123,6 @@ func update_playerboard_ui():
|
||||
if center_index != -1 and center_index < goals.size():
|
||||
var goal_value = goals[center_index]
|
||||
|
||||
# Check if player has collected this tile
|
||||
var _has_tile = item == goal_value
|
||||
|
||||
if item != -1:
|
||||
# Player has a tile in this slot - show it at full brightness
|
||||
match item:
|
||||
@@ -150,6 +148,35 @@ func update_playerboard_ui():
|
||||
8: slot.texture = item_tex[2]
|
||||
9: slot.texture = item_tex[3]
|
||||
10: slot.texture = item_tex[4]
|
||||
# Non-center slots always full brightness
|
||||
slot.modulate = Color.WHITE
|
||||
|
||||
# Check for new special tile placement to trigger effect
|
||||
if i < _previous_playerboard_state.size():
|
||||
var prev_item = _previous_playerboard_state[i]
|
||||
# If slot was empty or different, and now has a special tile (7-10)
|
||||
if item != prev_item and item >= 7 and item <= 10:
|
||||
_pulse_slot_effect(slot)
|
||||
|
||||
# Update cache
|
||||
_previous_playerboard_state = local_player_character.playerboard.duplicate()
|
||||
|
||||
func _pulse_slot_effect(slot: Control):
|
||||
"""Visual feedback when a special tile is placed."""
|
||||
var tween = create_tween()
|
||||
|
||||
# Reset scale first to be safe
|
||||
slot.scale = Vector2.ONE
|
||||
slot.pivot_offset = slot.size / 2 # Center pivot
|
||||
|
||||
# Pop effect
|
||||
tween.tween_property(slot, "scale", Vector2(1.4, 1.4), 0.15).set_trans(Tween.TRANS_BACK).set_ease(Tween.EASE_OUT)
|
||||
tween.tween_property(slot, "scale", Vector2(1.0, 1.0), 0.2).set_trans(Tween.TRANS_BOUNCE).set_ease(Tween.EASE_OUT)
|
||||
|
||||
# Flash effect
|
||||
var original_modulate = slot.modulate
|
||||
slot.modulate = Color(1.5, 1.5, 1.5) # Overbright
|
||||
tween.parallel().tween_property(slot, "modulate", original_modulate, 0.3)
|
||||
|
||||
func update_button_states():
|
||||
if not local_player_character or local_player_character.is_in_group("Bots"):
|
||||
|
||||
Reference in New Issue
Block a user