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/vectors.s | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/vectors.s') diff --git a/src/vectors.s b/src/vectors.s index 75de30a..77ce0bc 100644 --- a/src/vectors.s +++ b/src/vectors.s @@ -104,6 +104,12 @@ .endif ;; TODO: some actions here will depend on the status of the game... + lda Globals::zp_flags + and #%00000001 + bne @ppu_registers + + ;; Increase the random seed. + inc Prng::zp_rand ;; Decrease title timer. lda Title::zp_title_timer -- cgit v1.2.3