From d38a958f446aac1a6faa79277c140ab8a0ff03f4 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 18 Mar 2025 16:56:23 +0100 Subject: Expanded ground collision to the other platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This comes with a more general approach to handle background collision. Signed-off-by: Miquel Sabaté Solà --- src/background.s | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/background.s (limited to 'src/background.s') diff --git a/src/background.s b/src/background.s new file mode 100644 index 0000000..5a9c5fe --- /dev/null +++ b/src/background.s @@ -0,0 +1,28 @@ +.segment "CODE" + +.scope Background + ;; Screen coordinates on the Y axis for the ground. + GROUND_Y_COORD = $C8 + + ;; To make them easier to traverse when performing background collision + ;; checking, each platform is laid out in tile coordinates and spanning + ;; three bytes: tile row, tile column beginning, tile column end. + platforms: + ;; Top of the screen. + .byte $03, $00, $FF + + ;; Left platform. + .byte $09, $18, $1D + + ;; Center platform. + .byte $0C, $03, $08 + + ;; Right platform. + .byte $0F, $0F, $12 + + ;; Ground. + .byte $19, $00, $FF + + ;; End of the list. + .byte $FF +.endscope -- cgit v1.2.3