Skip to content

Commit

Permalink
version label, minor code improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
esbudylin committed Feb 22, 2023
1 parent 25481c1 commit ce86e48
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
11 changes: 11 additions & 0 deletions scenes/menu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,17 @@ margin_bottom = 21.0
custom_fonts/font = SubResource( 15 )
text = "Hexofen (Trubitsyn variant)"

[node name="Version" type="Label" parent="."]
anchor_top = 1.0
anchor_bottom = 1.0
margin_top = -19.0
margin_right = 26.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_constants/line_spacing = 6
custom_fonts/font = SubResource( 4 )
text = "v1.1"
align = 1

[connection signal="pressed" from="ColorRect/BackPanel" to="." method="_on_BackPanel_pressed"]
[connection signal="pressed" from="Menu/VBoxContainer/Local" to="." method="_on_Local_pressed"]
[connection signal="pressed" from="Menu/VBoxContainer/Host" to="Menu" method="_on_Host_pressed"]
Expand Down
9 changes: 4 additions & 5 deletions scr/Mapping.gd
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ func find_closest_tiles(position):
var closest_tiles = Array()

if int(position[0])%2!=0:
closest_tiles += [Vector2(position[0]+1, position[1]+1), \
closest_tiles = [Vector2(position[0]+1, position[1]+1), \
Vector2(position[0]+1, position[1]), \
Vector2(position[0], position[1]-1), \
Vector2(position[0]-1, position[1]), \
Vector2(position[0]-1, position[1]+1), \
Vector2(position[0], position[1]+1)]

else:
closest_tiles += [Vector2(position[0]+1, position[1]-1), \
closest_tiles = [Vector2(position[0]+1, position[1]-1), \
Vector2(position[0]+1, position[1]), \
Vector2(position[0], position[1]-1), \
Vector2(position[0]-1, position[1]), \
Expand All @@ -41,8 +41,7 @@ func find_closest_tiles(position):
return closest_tiles

func in_range_utility(position, tiles_in_range):
for tile in find_closest_tiles (position):

for tile in find_closest_tiles(position):
if not tile in tiles_in_range:
tiles_in_range.append(tile)

Expand Down Expand Up @@ -101,7 +100,7 @@ func bishop_diagonal(position, x, y, z = 1, iterations = 5):
current_tile[1] +=y

current_tile[0] += z
coord_tiles_local+= [current_tile]
coord_tiles_local.append(current_tile)

return coord_tiles_local

Expand Down

0 comments on commit ce86e48

Please sign in to comment.