Implemented most movement. TODO: Pillbug ability. And find and fix bugs witht he movement. TODO: Deselect when not movable
This commit is contained in:
parent
11f8a71f52
commit
76e4d6be34
33 changed files with 184 additions and 61 deletions
|
|
@ -1,2 +1,13 @@
|
|||
extends MovementBehaviour
|
||||
class_name MovementBehaviourPillbug
|
||||
|
||||
func get_available_spaces(pos: Vector4i, map: HexGrid) -> Array[Vector4i]:
|
||||
var potential_spaces = map.get_empty_neighbours(pos)
|
||||
|
||||
var target_spaces: Array[Vector4i] = []
|
||||
|
||||
for neighbour in potential_spaces:
|
||||
if map.can_reach(pos, neighbour):
|
||||
target_spaces.append(neighbour)
|
||||
|
||||
return target_spaces
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue