feat: Add player movement manager, main scene, and backflip animation asset.
This commit is contained in:
Binary file not shown.
@@ -964,6 +964,7 @@ grow_horizontal = 0
|
|||||||
grow_vertical = 0
|
grow_vertical = 0
|
||||||
|
|
||||||
[node name="ActionButtonContainer" type="VBoxContainer" parent="ActionMenu"]
|
[node name="ActionButtonContainer" type="VBoxContainer" parent="ActionMenu"]
|
||||||
|
visible = false
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_right = 40.0
|
offset_right = 40.0
|
||||||
offset_bottom = 40.0
|
offset_bottom = 40.0
|
||||||
@@ -974,11 +975,13 @@ layout_mode = 2
|
|||||||
text = "Move"
|
text = "Move"
|
||||||
|
|
||||||
[node name="GrabButton" type="Button" parent="ActionMenu/ActionButtonContainer"]
|
[node name="GrabButton" type="Button" parent="ActionMenu/ActionButtonContainer"]
|
||||||
|
visible = false
|
||||||
custom_minimum_size = Vector2(100, 100)
|
custom_minimum_size = Vector2(100, 100)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "Grab"
|
text = "Grab"
|
||||||
|
|
||||||
[node name="PutButton" type="Button" parent="ActionMenu/ActionButtonContainer"]
|
[node name="PutButton" type="Button" parent="ActionMenu/ActionButtonContainer"]
|
||||||
|
visible = false
|
||||||
custom_minimum_size = Vector2(100, 100)
|
custom_minimum_size = Vector2(100, 100)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "Put"
|
text = "Put"
|
||||||
|
|||||||
@@ -47,13 +47,17 @@ func simple_move_to(grid_position: Vector2i) -> bool:
|
|||||||
if distance != 1:
|
if distance != 1:
|
||||||
return false # Only single-step moves allowed
|
return false # Only single-step moves allowed
|
||||||
|
|
||||||
|
# Check if target position is within grid bounds
|
||||||
|
if not enhanced_gridmap.is_position_valid(grid_position):
|
||||||
|
return false
|
||||||
|
|
||||||
# Check for finish line logic (delegated back to player or race manager)
|
# Check for finish line logic (delegated back to player or race manager)
|
||||||
if player.has_method("can_move_to_finish") and not player.can_move_to_finish(grid_position):
|
if player.has_method("can_move_to_finish") and not player.can_move_to_finish(grid_position):
|
||||||
return false
|
return false
|
||||||
|
|
||||||
# Check walkability and obstacles
|
# Check walkability and obstacles
|
||||||
var cell_item = enhanced_gridmap.get_cell_item(Vector3i(grid_position.x, 0, grid_position.y))
|
var cell_item = enhanced_gridmap.get_cell_item(Vector3i(grid_position.x, 0, grid_position.y))
|
||||||
if cell_item in enhanced_gridmap.non_walkable_items or player.is_position_occupied(grid_position):
|
if cell_item == -1 or cell_item in enhanced_gridmap.non_walkable_items or player.is_position_occupied(grid_position):
|
||||||
return false
|
return false
|
||||||
|
|
||||||
if enhanced_gridmap.is_blocked_by_obstacle(player.current_position, grid_position, 3):
|
if enhanced_gridmap.is_blocked_by_obstacle(player.current_position, grid_position, 3):
|
||||||
@@ -75,6 +79,10 @@ func move_to_clicked_position(grid_position: Vector2i) -> bool:
|
|||||||
if not player.is_multiplayer_authority() or is_moving or player.action_points <= 0:
|
if not player.is_multiplayer_authority() or is_moving or player.action_points <= 0:
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
# Validate grid position is within bounds
|
||||||
|
if not enhanced_gridmap.is_position_valid(grid_position):
|
||||||
|
return false
|
||||||
|
|
||||||
# Check finish line logic
|
# Check finish line logic
|
||||||
if player.has_method("can_move_to_finish") and not player.can_move_to_finish(grid_position):
|
if player.has_method("can_move_to_finish") and not player.can_move_to_finish(grid_position):
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user