fix spider bat boss alittle
This commit is contained in:
@@ -9,21 +9,24 @@ const COLOR_UNEXPLORED: Color = Color(0.08, 0.08, 0.1)
|
||||
const COLOR_WALL: Color = Color(0.22, 0.22, 0.26)
|
||||
const COLOR_FLOOR: Color = Color(0.38, 0.38, 0.44)
|
||||
const COLOR_PLAYER: Color = Color(1.0, 0.35, 0.35)
|
||||
const COLOR_OTHER_PLAYER: Color = Color(0.35, 0.6, 1.0) # Blue for other players
|
||||
const COLOR_EXIT: Color = Color(1.0, 1.0, 1.0)
|
||||
|
||||
var _map_size: Vector2i = Vector2i.ZERO
|
||||
var _explored_map: PackedInt32Array = PackedInt32Array()
|
||||
var _grid: Array = [] # 2D grid [x][y]: 0=wall, 1=floor, 2=door, 3=corridor
|
||||
var _player_tile: Vector2i = Vector2i(-1, -1)
|
||||
var _other_player_tiles: Array = [] # Array of Vector2i for other players
|
||||
var _exit_tile: Vector2i = Vector2i(-1, -1)
|
||||
var _exit_discovered: bool = false
|
||||
|
||||
|
||||
func set_maps(explored_map: PackedInt32Array, map_size: Vector2i, grid: Array, player_tile: Vector2i = Vector2i(-1, -1), exit_tile: Vector2i = Vector2i(-1, -1), exit_discovered: bool = false) -> void:
|
||||
func set_maps(explored_map: PackedInt32Array, map_size: Vector2i, grid: Array, player_tile: Vector2i = Vector2i(-1, -1), exit_tile: Vector2i = Vector2i(-1, -1), exit_discovered: bool = false, other_player_tiles: Array = []) -> void:
|
||||
_explored_map = explored_map
|
||||
_map_size = map_size
|
||||
_grid = grid
|
||||
_player_tile = player_tile
|
||||
_other_player_tiles = other_player_tiles
|
||||
_exit_tile = exit_tile
|
||||
_exit_discovered = exit_discovered
|
||||
queue_redraw()
|
||||
@@ -73,6 +76,12 @@ func _draw() -> void:
|
||||
var py := float(_player_tile.y) * th + th * 0.5
|
||||
var r := maxf(2.0, minf(tw, th) * 0.4)
|
||||
draw_circle(Vector2(px, py), r, COLOR_PLAYER)
|
||||
for other_tile in _other_player_tiles:
|
||||
if other_tile is Vector2i and other_tile.x >= 0 and other_tile.y >= 0 and other_tile.x < _map_size.x and other_tile.y < _map_size.y:
|
||||
var ox := float(other_tile.x) * tw + tw * 0.5
|
||||
var oy := float(other_tile.y) * th + th * 0.5
|
||||
var or_ := maxf(1.5, minf(tw, th) * 0.32)
|
||||
draw_circle(Vector2(ox, oy), or_, COLOR_OTHER_PLAYER)
|
||||
if _exit_discovered and _exit_tile.x >= 0 and _exit_tile.y >= 0 and _exit_tile.x < _map_size.x and _exit_tile.y < _map_size.y:
|
||||
var ex := float(_exit_tile.x) * tw + tw * 0.5
|
||||
var ey := float(_exit_tile.y) * th + th * 0.5
|
||||
|
||||
Reference in New Issue
Block a user