From 23ccde0f60ef45667e17cd03b90a44fa9ac6d73c Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Thu, 10 Oct 2024 05:52:51 +0200 Subject: [PATCH] Added tempalte for collision shapes --- src/collision.s | 27 +++++++++++++++++++++++++++ src/main.s | 1 + 2 files changed, 28 insertions(+) create mode 100644 src/collision.s diff --git a/src/collision.s b/src/collision.s new file mode 100644 index 0000000..de0d74b --- /dev/null +++ b/src/collision.s @@ -0,0 +1,27 @@ + ; collision shapes: + ; a collision shape is a collection of dots + ; relative to a sprite + ; structure: + ; N: Amount of dots + ; Y: y position + ; X: x position + ; y and x repeat until N is reached + + ; defines a collision header + ; inputs: + ; $1: N +#macro col_head + .db $1 +#endmacro + + ; defines a collsion point + ; inputs: + ; $1: y + ; $2: x +#macro col_point + .db $1, $2 +#endmacro + +collision_player: + col_head 1 + col_point 1, 1 diff --git a/src/main.s b/src/main.s index d64f6ca..43363f7 100644 --- a/src/main.s +++ b/src/main.s @@ -53,6 +53,7 @@ main: #include "update.s" #include "map.s" #include "ui.s" +#include "collision.s" #include "tiles.inc" -- 2.30.2