From ecdc16c7f050b1d0bd63412b4ba3ac5cef758488 Mon Sep 17 00:00:00 2001 From: Lucas Fryzek <lucas.fryzek@fryzekconcepts.com> Date: Thu, 20 Mar 2025 22:24:59 +0000 Subject: Add tile blocking logic --- main.rhm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'main.rhm') diff --git a/main.rhm b/main.rhm index f3c5188..6911dc0 100644 --- a/main.rhm +++ b/main.rhm @@ -23,7 +23,7 @@ wrld.entities.add(entity) reset_entity(entity) test(entity.move(1, 0), "move horizontal") -reset_entity(entity) +reset_entity(entity, 1, 1) test(entity.move(0, 1), "move vertical") reset_entity(entity) @@ -41,7 +41,11 @@ reset_entity(entity, 63, 0) test(entity.move(64, 0), "cross chunk") test(entity.current_chunk == new_chunk, "changed chunk") -//world.entities -println(@str{Entity is @(entity.x) @(entity.y)}) - +entity.current_chunk := chunk +reset_entity(entity, 0, 1) +entity.current_chunk.set_tile(0, 1, world.Tile(#'wall_north)) +test(!entity.move(0, 0), "Blocked by wall") +test(entity.move(1,1), "Move by wall") +//world.entities +//println(@str{Entity is @(entity.x) @(entity.y)}) -- cgit v1.2.3