From d6053f73792e85fbc71d5695ee13253d0bd56178 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Fri, 12 May 2023 07:43:41 +0100 Subject: Set player start address Also differentiate bewteen initialising the program and the game. --- game/main.asm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'game/main.asm') diff --git a/game/main.asm b/game/main.asm index cdf0844..bfc203c 100644 --- a/game/main.asm +++ b/game/main.asm @@ -3,6 +3,7 @@ .equ INT_VECTOR 0xff00 call init + call init_game game_loop: halt @@ -27,9 +28,23 @@ init: ; enable interrupts cif + ret +init_game: halt + ; set player initial coordinates + ld x, player_coord + + ld y, 56 + ld [a : x], y + inc x + bo + inc a + ld y, 104 + ld [a : x], y + ; erase the screen ld b, 0 ld a, 0xbf @@ -64,6 +79,7 @@ entities: ; type .db ET_PLAYER ; x, y +player_coord: .db 0, 0 ; frame .db 0 -- cgit v1.2.3