From 638dfdca6e773d4b1ec573606cac90bdb1778667 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 15 May 2025 22:06:00 +0200 Subject: Initialize enemies at a random Y coordinate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The randomness comes from a pre-computed table of "random" numbers. This is of course the most simple technique you can come across a code base for the NES/Famicom, but for the purposes of this game is good enough and (most importantly) fast. Signed-off-by: Miquel Sabaté Solà --- src/background.s | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/background.s') diff --git a/src/background.s b/src/background.s index add7059..26d38c6 100644 --- a/src/background.s +++ b/src/background.s @@ -1,6 +1,10 @@ .segment "CODE" .scope Background + ;; Screen coordinate on the Y axis where elements can begin to appear (e.g. + ;; upper bound for new enemies, starting point for falling items, etc.). + UPPER_MARGIN_Y_COORD = $10 + ;; Screen coordinates on the Y axis for the ground. GROUND_Y_COORD = $C8 -- cgit v1.2.3