Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/part3/the-player.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The player’s logic is pretty simple. The player can move in 4 directions and fire bullets. We update the player by checking our input directions and the A button. We’ll move in the proper direction if its associated d-pad button is pressed. If the A button is pressed, we’ll spawn a new bullet at the player’s position.

Our player will have 3 variables:
- wePlayerPositionX - a 16-bit scaled integer
- wePlayerPositionY - a 16-bit scaled integer
- wPlayerPositionX - a 16-bit scaled integer
- wPlayerPositionY - a 16-bit scaled integer
- wPlayerFlash - a 16-bit integer used when the player gets damaged

:::warning Note
Expand All @@ -19,15 +19,15 @@ These are declared at the top of the "src/main/states/gameplay/objects/player.as
{{#include ../../galactic-armada/src/main/states/gameplay/objects/player.asm:player-start}}
```

Well draw our player, a simple ship, using the previously discussed metasprites implementation. Here is what we have for the players metasprites and tile data:
We'll draw our player, a simple ship, using the previously discussed metasprites implementation. Here is what we have for the players metasprites and tile data:
```rgbasm,linenos,start={{#line_no_of "" ../../galactic-armada/src/main/states/gameplay/objects/player.asm:player-data}}
{{#include ../../galactic-armada/src/main/states/gameplay/objects/player.asm:player-data}}
```

## Initializing the Player

Initializing the player is pretty simple. Here's a list of things we need to do:
* Reset oir wPlayerFlash variable
* Reset our wPlayerFlash variable
* Reset our wPlayerPositionX variable
* Reset our wPlayerPositionU variable
* Copy the player's ship into VRAM
Expand Down
Loading