Skip to content

Commit 189aa93

Browse files
authored
Fix inconsistent variable name for 'PlayerFlash' (#200)
1 parent bfd68ad commit 189aa93

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

galactic-armada/src/main/states/gameplay/objects/player.asm

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SECTION "PlayerVariables", WRAM0
88
wPlayerPositionX:: dw
99
wPlayerPositionY:: dw
1010

11-
mPlayerFlash: dw
11+
wPlayerFlash: dw
1212
; ANCHOR_END: player-start
1313
; ANCHOR: player-data
1414
SECTION "Player", ROM0
@@ -28,8 +28,8 @@ playerTestMetaSprite::
2828
InitializePlayer::
2929

3030
xor a
31-
ld [mPlayerFlash], a
32-
ld [mPlayerFlash+1], a
31+
ld [wPlayerFlash], a
32+
ld [wPlayerFlash+1], a
3333

3434
; Place in the middle of the screen
3535
xor a
@@ -79,10 +79,10 @@ UpdatePlayer_HandleInput:
7979
8080

8181
; ANCHOR: player-update-flashing
82-
ld a, [mPlayerFlash+0]
82+
ld a, [wPlayerFlash+0]
8383
ld b, a
8484

85-
ld a, [mPlayerFlash+1]
85+
ld a, [wPlayerFlash+1]
8686
ld c, a
8787

8888
UpdatePlayer_UpdateSprite_CheckFlashing:
@@ -103,9 +103,9 @@ UpdatePlayer_UpdateSprite_CheckFlashing:
103103
UpdatePlayer_UpdateSprite_DecreaseFlashing:
104104

105105
ld a, b
106-
ld [mPlayerFlash], a
106+
ld [wPlayerFlash], a
107107
ld a, c
108-
ld [mPlayerFlash+1], a
108+
ld [wPlayerFlash+1], a
109109

110110
; descale bc
111111
srl c
@@ -131,8 +131,8 @@ UpdatePlayer_UpdateSprite_Flashing:
131131
UpdatePlayer_UpdateSprite_StopFlashing:
132132

133133
xor a
134-
ld [mPlayerFlash],a
135-
ld [mPlayerFlash+1],a
134+
ld [wPlayerFlash],a
135+
ld [wPlayerFlash+1],a
136136
; ANCHOR_END: player-update-flashing
137137

138138
; ANCHOR: player-update-sprite
@@ -215,9 +215,9 @@ DamagePlayer::
215215
ld [wUpdateHud], a; Tell gameplay-state to update hud
216216

217217
xor a
218-
ld [mPlayerFlash], a
218+
ld [wPlayerFlash], a
219219
inc a
220-
ld [mPlayerFlash+1], a
220+
ld [wPlayerFlash+1], a
221221

222222
ld a, [wLives]
223223
dec a

src/part3/the-player.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ If we get past all of the "wPlayerFlash" logic, we'll draw our player using the
9292
{{#include ../../galactic-armada/src/main/states/gameplay/objects/player.asm:player-update-sprite}}
9393
```
9494

95-
That's the end our our "UpdatePlayer" function. The final bit of code for our player handles when they are damaged. When an enemy damages the player, we want to decrease our lives by one. We'll also start flashing by giving our 'mPlayerFlash' variable a non-zero value. In the gameplay game state, if we've lost all lives, gameplay will end.
95+
That's the end our our "UpdatePlayer" function. The final bit of code for our player handles when they are damaged. When an enemy damages the player, we want to decrease our lives by one. We'll also start flashing by giving our 'wPlayerFlash' variable a non-zero value. In the gameplay game state, if we've lost all lives, gameplay will end.
9696

9797
```rgbasm,linenos,start={{#line_no_of "" ../../galactic-armada/src/main/states/gameplay/objects/player.asm:player-damage}}
9898
{{#include ../../galactic-armada/src/main/states/gameplay/objects/player.asm:player-damage}}

0 commit comments

Comments
 (0)