From 681ba9adf948ebdc909b08979c76251053af7a9e Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Thu, 11 May 2023 20:57:55 +0100 Subject: Add starfield effect --- game/main.asm | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 3 deletions(-) (limited to 'game/main.asm') diff --git a/game/main.asm b/game/main.asm index 68d1267..e779a95 100644 --- a/game/main.asm +++ b/game/main.asm @@ -8,6 +8,7 @@ game_loop: halt call entities_erase + call stars_update call entities_update call entities_draw @@ -29,14 +30,13 @@ init: halt - ; pattern for the BG - ld b, 15 + ; erase the screen + ld b, 0 ld a, 0xbf ld x, 0 ld y, 0x40 fill_loop: ld [a : x], b - xor b, 5 inc x bno jmp fill_loop @@ -52,6 +52,7 @@ fill_loop: int_handler: iret +.include "starfield.asm" .include "entities.asm" .include "player.asm" @@ -75,3 +76,50 @@ entities: player_sprite: .incpng "assets/player.png" +; starfield data +stars: + ; video addr, speed, color + .dw 0xc361 + .db 1, 15 + .dw 0xc204 + .db 1, 6 + .dw 0xcdf9 + .db 1, 15 + .dw 0xdb87 + .db 1, 3 + .dw 0xd242 + .db 1, 15 + .dw 0xdeea + .db 1, 6 + .dw 0xe7af + .db 1, 15 + .dw 0xed68 + .db 1, 3 + .dw 0xf812 + .db 1, 15 + .dw 0xfbca + .db 1, 13 + .dw 0xc361 + .db 2, 8 + .dw 0xc204 + .db 2, 9 + .dw 0xcdf9 + .db 3, 7 + .dw 0xdb87 + .db 3, 4 + .dw 0xd242 + .db 2, 8 + .dw 0xdeea + .db 3, 9 + .dw 0xe7af + .db 3, 6 + .dw 0xed68 + .db 2, 9 + .dw 0xf812 + .db 3, 14 + .dw 0xfbca + .db 2, 3 + ; end of list + .dw 0xffff + + -- cgit v1.2.3