aboutsummaryrefslogtreecommitdiff
path: root/src/background.s
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2025-05-15 22:06:00 +0200
committerMiquel Sabaté Solà <mikisabate@gmail.com>2025-05-16 07:55:56 +0200
commit638dfdca6e773d4b1ec573606cac90bdb1778667 (patch)
tree73f60ee0aca0c0585f0fd8063ccc7bb31881e543 /src/background.s
parent72894d68c4fbd8c2b843afa70244dee3b6241414 (diff)
downloadjetpac.nes-638dfdca6e773d4b1ec573606cac90bdb1778667.tar.gz
jetpac.nes-638dfdca6e773d4b1ec573606cac90bdb1778667.zip
Initialize enemies at a random Y coordinate
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à <mikisabate@gmail.com>
Diffstat (limited to 'src/background.s')
-rw-r--r--src/background.s4
1 files changed, 4 insertions, 0 deletions
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