Godot Version
4.7.2
Question
I’m playing a bit with changing look of GridMap in Platformer 2.5D.
In level are levers which makes appears extra block for player to be able jump and pass to next passage.
But current look of the code is really too much copy and paste, what kind of variables and call should I use to do logic of set_cell_items and after set amount of time delete them.
Current code works, but someone might have some idea how to make it more elegant.
func second_steps_appear() ->void:
set_cell_item(Vector3i(21,0,-10),0)
set_cell_item(Vector3i(22,0,-10),0)
set_cell_item(Vector3i(23,0,-10),0)
set_cell_item(Vector3i(24,0,-10),0)
set_cell_item(Vector3i(25,0,-10),0)
set_cell_item(Vector3i(26,0,-10),0)
await get_tree().create_timer(7.0).timeout
set_cell_item(Vector3i(21,0,-10),-1)
set_cell_item(Vector3i(22,0,-10),-1)
set_cell_item(Vector3i(23,0,-10),-1)
set_cell_item(Vector3i(24,0,-10),-1)
set_cell_item(Vector3i(25,0,-10),-1)
set_cell_item(Vector3i(26,0,-10),-1)