feat: Add initial player character, movement, network synchronization, bot AI, and game managers.
This commit is contained in:
@@ -1283,6 +1283,7 @@ func move_player_to_clicked_position(grid_position: Vector2i):
|
||||
|
||||
@rpc("any_peer", "call_local")
|
||||
func start_movement_along_path(path: Array, clear_visual: bool = true):
|
||||
print("[Player] %s starting move along path: %s" % [name, path])
|
||||
# SERVER-SIDE VIOLATION CHECK (for Stop n Go)
|
||||
if multiplayer.is_server() and LobbyManager.game_mode == "Stop n Go":
|
||||
var main = get_tree().root.get_node_or_null("Main")
|
||||
@@ -1317,10 +1318,13 @@ func start_movement_along_path(path: Array, clear_visual: bool = true):
|
||||
tween.tween_property(self , "global_position", grid_to_world(Vector2i(point.x, point.y)), step_duration)
|
||||
|
||||
tween.tween_callback(func():
|
||||
var old_pos = current_position
|
||||
current_position = Vector2i(path[-1].x, path[-1].y)
|
||||
is_player_moving = false
|
||||
target_position = Vector2i(-1, -1)
|
||||
|
||||
print("[Player] %s finished move. %s -> %s" % [name, old_pos, current_position])
|
||||
|
||||
if is_carrying_tekton and is_instance_valid(carried_tekton):
|
||||
carried_tekton.current_position = current_position
|
||||
|
||||
|
||||
Reference in New Issue
Block a user