aboutsummaryrefslogtreecommitdiff
path: root/src/enemies.s
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-03-20 21:52:36 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-03-22 15:17:24 +0100
commitfb23cf51040f06bfcfbaf318d7b452d76ffbedfb (patch)
treec65bd96d3789cb8dd60e1f6baf7942a68528a84a /src/enemies.s
parentb7ec9a63ebf0895f9c1940772a5735f905cccfb8 (diff)
downloadjetpac.nes-fb23cf51040f06bfcfbaf318d7b452d76ffbedfb.tar.gz
jetpac.nes-fb23cf51040f06bfcfbaf318d7b452d76ffbedfb.zip
Try to initialize enemies on unique Y coordinates
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à <mssola@mssola.com>
Diffstat (limited to 'src/enemies.s')
-rw-r--r--src/enemies.s2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/enemies.s b/src/enemies.s
index 6201416..2208758 100644
--- a/src/enemies.s
+++ b/src/enemies.s
@@ -244,7 +244,7 @@
;; The Y coordinate is also set at random within the bounds of the
;; playable screen.
- jsr Prng::random_valid_y_coordinate
+ jsr Prng::random_non_repeated_valid_y_coordinate
ldx Globals::zp_tmp0
inx
sta Enemies::zp_pool_base, x