@@ -40,7 +40,7 @@ InitializeBullets::
4040 xor a
4141 ld [ wSpawnBullet ], a
4242
43- ; Copy the bullet tile data intto vram
43+ ; Copy the bullet tile data into vram
4444 ld de , bulletTileData
4545 ld hl , BULLET_TILES_START
4646 ld bc , bulletTileDataEnd - bulletTileData
@@ -52,10 +52,12 @@ InitializeBullets::
5252
5353 ld b , a
5454 ld hl , wBullets
55- ld [ hl ], a
5655
5756InitializeBullets_Loop:
5857
58+ ; Set as inactive
59+ ld [ hl ], 0
60+
5961 ; Increase the address
6062 ld a , l
6163 add PER_BULLET_BYTES_COUNT
@@ -64,7 +66,7 @@ InitializeBullets_Loop:
6466 adc 0
6567 ld h , a
6668
67- ; Increase how many bullets we have initailized
69+ ; Increase how many bullets we have initialized
6870 ld a , b
6971 inc a
7072 ld b , a
@@ -78,7 +80,7 @@ InitializeBullets_Loop:
7880; ANCHOR: bullets-update-start
7981UpdateBullets::
8082
81- ; Make sure we have SOME active enemies
83+ ; Make sure we have SOME active bullets
8284 ld a , [ wSpawnBullet ]
8385 ld b , a
8486 ld a , [ wActiveBulletCounter ]
@@ -113,7 +115,7 @@ UpdateBullets_Loop:
113115 cp MAX_BULLET_COUNT
114116 ret nc
115117
116- ; Increase the bullet data our address is pointingtwo
118+ ; Increase the bullet data our address is pointing to
117119 ld a , l
118120 add PER_BULLET_BYTES_COUNT
119121 ld l , a
@@ -126,13 +128,13 @@ UpdateBullets_Loop:
126128UpdateBullets_PerBullet:
127129
128130 ; The first byte is if the bullet is active
129- ; If it's NOT zero, it's active, go to the normal update section
131+ ; If it's NOT zero, it's active, go to the normal update section
130132 ld a , [ hl ]
131133 and a
132134 jp nz , UpdateBullets_PerBullet_Normal
133135
134136 ; Do we need to spawn a bullet?
135- ; If we dont , loop to the next enemy
137+ ; If we don't , loop to the next bullet
136138 ld a , [ wSpawnBullet ]
137139 and a
138140 jp z , UpdateBullets_Loop
@@ -150,7 +152,7 @@ UpdateBullets_PerBullet_SpawnDeactivatedBullet:
150152
151153 push hl
152154
153- ; Set the current bullet as active
155+ ; Set the current bullet as active
154156 ld a , 1
155157 ld [ hli ], a
156158
@@ -161,7 +163,7 @@ UpdateBullets_PerBullet_SpawnDeactivatedBullet:
161163 ld d , a
162164
163165 ; Descale the player's x position
164- ; the result will only be in the low byt
166+ ; the result will only be in the low byte
165167 srl d
166168 rr b
167169 srl d
@@ -220,7 +222,7 @@ UpdateBullets_PerBullet_Normal:
220222
221223 ; See if our non scaled low byte is above 160
222224 ld a , c
223- cp 178
225+ cp 160
224226 ; If it's below 160, deactivate
225227 jp nc , UpdateBullets_DeActivateIfOutOfBounds
226228
@@ -233,8 +235,8 @@ UpdateBullets_PerBullet_Normal:
233235 ;; Drawing a metasprite
234236 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
235237
236- ; Save the address of the metasprite into the 'wMetaspriteAddress' variable
237- ; Our DrawMetasprites functoin uses that variable
238+ ; Save the address of the metasprite into the 'wMetaspriteAddress' variable
239+ ; Our DrawMetasprites function uses that variable
238240 ld a , LOW(bulletMetasprite)
239241 ld [ wMetaspriteAddress ], a
240242 ld a , HIGH(bulletMetasprite)
@@ -248,7 +250,7 @@ UpdateBullets_PerBullet_Normal:
248250 ld a , c
249251 ld [ wMetaspriteY ], a
250252
251- ; Actually call the 'DrawMetasprites function
253+ ; Actually call the 'DrawMetasprites' function
252254 call DrawMetasprites
253255
254256 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -278,7 +280,7 @@ UpdateBullets_DeActivateIfOutOfBounds:
278280; ANCHOR: fire-bullets
279281FireNextBullet::
280282
281- ; Make sure we don't have the max amount of enmies
283+ ; Make sure we don't have the max amount of bullets
282284 ld a , [ wActiveBulletCounter ]
283285 cp MAX_BULLET_COUNT
284286 ret nc
0 commit comments