From 933b10c882a7b72a72a184d788d8fc67e829e0d6 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sat, 6 May 2023 19:21:47 +0100 Subject: Will bounce the walls --- example.asm | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 95 insertions(+), 13 deletions(-) (limited to 'example.asm') diff --git a/example.asm b/example.asm index cffef5e..48ee7db 100644 --- a/example.asm +++ b/example.asm @@ -19,30 +19,98 @@ ; enable interrupts cif - ; loop filling the screen with one - ; colour cycling the whole palette ld b, 0 loop: - call fill + call fill_screen + push b + + ; update sprite position + + ld a, >incx + ld x, -1 + ; -1 -> 1 + ld a, >incx + ld x, incy + ld x, -1 + ; -1 -> 1 + ld a, >incy + ld x, sprite port a, x - ; destination (56, 56) - ld x, 56 + ld y, px + ld x, [b : y] port a, x + ld y, py + ld x, [b : y] port a, x ; size 16x16 ld x, 16 @@ -92,3 +165,12 @@ draw_sprite: sprite: .incpng "assets/icon.png" +incx: + .db 1 +px: + .db 18 +incy: + .db 1 +py: + .db 64 + -- cgit v1.2.3