diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-03-18 16:56:23 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-03-18 16:56:23 +0100 |
| commit | d38a958f446aac1a6faa79277c140ab8a0ff03f4 (patch) | |
| tree | 7d9551f96f321a6eb4a5b56870425b4e3a1e1ccc /src/background.s | |
| parent | 93f3db33eeb5bfd59f539c3e1d2cb978a3e325be (diff) | |
| download | jetpac.nes-d38a958f446aac1a6faa79277c140ab8a0ff03f4.tar.gz jetpac.nes-d38a958f446aac1a6faa79277c140ab8a0ff03f4.zip | |
Expanded ground collision to the other platforms
This comes with a more general approach to handle background collision.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'src/background.s')
| -rw-r--r-- | src/background.s | 28 |
1 files changed, 28 insertions, 0 deletions
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 |
