continued player handling
This commit is contained in:
parent
10eaf40c64
commit
db749e0df2
@ -614,7 +614,7 @@ func set_player(p):
|
|||||||
|
|
||||||
|
|
||||||
func init_player():
|
func init_player():
|
||||||
var tile = debug_map[int(INITIAL_GRID_SIZE_WIDTH/2)][INITIAL_GRID_SIZE_LENGTH/2][1]
|
var tile = debug_map[10][10][1]
|
||||||
tile["visibility"] = true
|
tile["visibility"] = true
|
||||||
tile["unit"] = player_node
|
tile["unit"] = player_node
|
||||||
tile["unit_type"] ="PC"
|
tile["unit_type"] ="PC"
|
||||||
@ -625,23 +625,30 @@ func _on_player_z_layer_change_pressed() -> void:
|
|||||||
var new_z = 0
|
var new_z = 0
|
||||||
var new_y = 0
|
var new_y = 0
|
||||||
var new_x = 0
|
var new_x = 0
|
||||||
|
var tile = debug_map[0][0][0]
|
||||||
for z in GRID_SIZE_HEIGHT:
|
for z in GRID_SIZE_HEIGHT:
|
||||||
for x in GRID_SIZE_WIDTH:
|
for x in GRID_SIZE_WIDTH:
|
||||||
for y in GRID_SIZE_LENGTH:
|
for y in GRID_SIZE_LENGTH:
|
||||||
var tile = debug_map[x][y][z]
|
tile = debug_map[x][y][z]
|
||||||
if tile["unit_type"] == "PC":
|
if tile["unit_type"] == "PC":
|
||||||
new_z = z + 1
|
new_z = z + 1
|
||||||
new_y = y - 1
|
new_y = y
|
||||||
new_x = x - 1
|
new_x = x
|
||||||
tile["unit"] = null
|
break
|
||||||
tile["unit_tpye"] = null
|
if tile["unit_type"] == "PC":
|
||||||
tile["visibility"] = null
|
break
|
||||||
|
if tile["unit_type"] == "PC":
|
||||||
|
break
|
||||||
|
print("x ", new_x, " y ", new_y, " z ", new_z)
|
||||||
|
tile["unit"] = null
|
||||||
|
tile["unit_type"] = null
|
||||||
|
tile["visibility"] = null
|
||||||
|
|
||||||
|
|
||||||
var new_player_tile = debug_map[new_x][new_y][new_z]
|
var new_player_tile = debug_map[new_x][new_y][new_z]
|
||||||
new_player_tile["unit"] = null
|
new_player_tile["unit"] = player_node
|
||||||
new_player_tile["unit_tpye"] = null
|
new_player_tile["visibility"] = true
|
||||||
new_player_tile["visibility"] = null
|
new_player_tile["unit_type"] ="PC"
|
||||||
player_node.set_unit_position(new_player_tile["x"], new_player_tile["y"], new_player_tile["z"])
|
player_node.set_unit_position(new_player_tile["x"], new_player_tile["y"], new_player_tile["z"])
|
||||||
|
|
||||||
|
|
||||||
@ -650,21 +657,34 @@ func _on_player_z_layer_change_down_pressed() -> void:
|
|||||||
var new_z = 0
|
var new_z = 0
|
||||||
var new_y = 0
|
var new_y = 0
|
||||||
var new_x = 0
|
var new_x = 0
|
||||||
|
var tile = debug_map[0][0][0]
|
||||||
for z in GRID_SIZE_HEIGHT:
|
for z in GRID_SIZE_HEIGHT:
|
||||||
for x in GRID_SIZE_WIDTH:
|
for x in GRID_SIZE_WIDTH:
|
||||||
for y in GRID_SIZE_LENGTH:
|
for y in GRID_SIZE_LENGTH:
|
||||||
var tile = debug_map[x][y][z]
|
tile = debug_map[x][y][z]
|
||||||
if tile["unit_type"] == "PC":
|
if tile["unit_type"] == "PC":
|
||||||
new_z = z - 1
|
new_z = z - 1
|
||||||
new_y = y + 1
|
new_y = 1
|
||||||
new_x = x + 1
|
new_x = 1
|
||||||
tile["unit"] = null
|
break
|
||||||
tile["unit_tpye"] = null
|
if tile["unit_type"] == "PC":
|
||||||
tile["visibility"] = null
|
print("y ", tile)
|
||||||
|
break
|
||||||
|
if tile["unit_type"] == "PC":
|
||||||
|
print("x ", tile)
|
||||||
|
break
|
||||||
|
if tile["unit_type"] == "PC":
|
||||||
|
print("z ", tile)
|
||||||
|
break
|
||||||
|
print("tile ", tile)
|
||||||
|
print("x ", new_x, " y ", new_y, " z ", new_z)
|
||||||
|
tile["unit"] = null
|
||||||
|
tile["unit_type"] = null
|
||||||
|
tile["visibility"] = null
|
||||||
|
|
||||||
|
|
||||||
var new_player_tile = debug_map[new_x][new_y][new_z]
|
var new_player_tile = debug_map[new_x][new_y][new_z]
|
||||||
new_player_tile["unit"] = null
|
new_player_tile["visibility"] = true
|
||||||
new_player_tile["unit_tpye"] = null
|
new_player_tile["unit"] = player_node
|
||||||
new_player_tile["visibility"] = null
|
new_player_tile["unit_type"] ="PC"
|
||||||
player_node.set_unit_position(new_player_tile["x"], new_player_tile["y"], new_player_tile["z"])
|
player_node.set_unit_position(new_player_tile["x"], new_player_tile["y"], new_player_tile["z"])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user