From fb23cf51040f06bfcfbaf318d7b452d76ffbedfb Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Fri, 20 Mar 2026 21:52:36 +0100 Subject: Try to initialize enemies on unique Y coordinates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That is, our PRNG algorithm is so stupid that sometimes it cycles into the same value multiple times. While play testing, sometimes we were so unlucky that we got all enemies on the same Y screen coordinate. As funny as these situations can be, this shouldn't happen, so I have introduced an (awesomely named) function that makes a harder effort at finding a unique random number. Signed-off-by: Miquel Sabaté Solà --- src/jetpac.s | 1 + 1 file changed, 1 insertion(+) (limited to 'src/jetpac.s') diff --git a/src/jetpac.s b/src/jetpac.s index f99c8b0..3cf8f0a 100644 --- a/src/jetpac.s +++ b/src/jetpac.s @@ -130,6 +130,7 @@ sta Joypad::zp_prev sta Player::zp_state sta Items::zp_state + sta Prng::zp_last_rand ;; Initialize the level. We allow the build system to pass its own value for ;; this in `LEVEL`, just in case we want to debug the enemy of a specific -- cgit v1.2.3