14 lines
370 B
GDScript3
14 lines
370 B
GDScript3
|
extends Node2D
|
||
|
class_name TK_GridContext
|
||
|
|
||
|
## todo: Cell visualization.
|
||
|
## todo: Integration of TileMap.
|
||
|
|
||
|
export var cell_size: Vector2 = Vector2(64, 64)
|
||
|
|
||
|
func position_to_cell_position(p_position: Vector2) -> Vector2:
|
||
|
return Arithmetic.vector2_mod(global_position - p_position, cell_size)
|
||
|
|
||
|
func is_cell_traversible(p_cell_position: Vector2) -> bool:
|
||
|
return true
|