simple composable grid context and grid controller, fiend sprite, godotxel addon

This commit is contained in:
veclav talica
2023-11-24 04:02:18 +05:00
commit 9441aa63cb
180 changed files with 9040 additions and 0 deletions

View File

@ -0,0 +1,8 @@
extends Node
class_name TK_Arithmetic
static func float_mod(p_a: float, p_b: float) -> float:
return p_a - (p_b * floor(p_a / p_b))
static func vector2_mod(p_a: Vector2, p_b: Vector2) -> Vector2:
return p_a - (p_b * (p_a / p_b).floor())

View File

@ -0,0 +1,13 @@
extends Node
func input_event_to_4way_direction(p_event: InputEvent) -> Vector2:
var result := Vector2.ZERO
if p_event.is_action_pressed("move_down"):
result.y += 1
if p_event.is_action_pressed("move_right"):
result.x += 1
if p_event.is_action_pressed("move_up"):
result.y -= 1
if p_event.is_action_pressed("move_left"):
result.x -= 1
return result