Added tempalte for collision shapes
authorLukas Krickl <lukas@krickl.dev>
Thu, 10 Oct 2024 03:52:51 +0000 (05:52 +0200)
committerLukas Krickl <lukas@krickl.dev>
Thu, 10 Oct 2024 03:52:51 +0000 (05:52 +0200)
src/collision.s [new file with mode: 0644]
src/main.s

diff --git a/src/collision.s b/src/collision.s
new file mode 100644 (file)
index 0000000..de0d74b
--- /dev/null
@@ -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
index d64f6ca32a9095c8aa220d88ee5f43a2cdd3002d..43363f7a05daaef3bbddad4518d71786d2e02ed6 100644 (file)
@@ -53,6 +53,7 @@ main:
 #include "update.s"
 #include "map.s"
 #include "ui.s"
+#include "collision.s"
 
 #include "tiles.inc"