Skip to content

Commit 993f056

Browse files
committed
part3: formatting improvements and more consistent usage of info boxes
1 parent d32f729 commit 993f056

File tree

4 files changed

+32
-27
lines changed

4 files changed

+32
-27
lines changed

src/part1/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ We will need:
1212
::: tip:❓😕
1313

1414
The following install instructions are provided on a "best-effort" basis, but may be outdated, or not work for you for some reason.
15-
Don't worry, we're here to help: [ask away in GBDev](../index.md#feedback), and we'll help you with installing everything!
15+
Don't worry, we're here to help: [ask away](../help-feedback.md), and we'll help you with installing everything!
1616

1717
:::
1818

src/part3/changing-game-states.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,20 @@ When one game state wants to go to another, it will need to change our previousl
1414

1515
(during a Vertical Blank)
1616

17-
* Turn off the LCD
18-
* Reset our Background & Window positions
19-
* Clear the Background
20-
* Disable Interrupts
21-
* Clear All Sprites
22-
* Initiate our NEXT game state
23-
* Jump to our NEXT game state's (looping) update logic
17+
- Turn off the LCD
18+
- Reset our Background & Window positions
19+
- Clear the Background
20+
- Disable Interrupts
21+
- Clear All Sprites
22+
- Initiate our NEXT game state
23+
- Jump to our NEXT game state's (looping) update logic
2424

2525
> It will be the responsibility of the "init" function for each game state to turn the LCD back on.
2626
2727
```rgbasm,linenos,start={{#line_no_of "" ../../galactic-armada/src/main/GalacticArmada.asm:next-game-state}}
2828
{{#include ../../galactic-armada/src/main/GalacticArmada.asm:next-game-state}}
2929
```
30-
The goal here is to ( as much as possible) give each new game state a "blank slate" to start with.
31-
That's it for the GalacticArmada.asm file,
30+
31+
The goal here is to ( as much as possible) give each new game state a _blank slate_ to start with.
32+
33+
That's it for the GalacticArmada.asm file.

src/part3/entry-point.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,25 @@
22

33
We'll start this tutorial out like the previous, with our "header" section (at address: $100). We're also going to declare some global variables that will be used throughout the game.
44

5-
- wLastKeys and wCurKeys are used for joypad input
6-
- wGameState will keep track what our current game state is
5+
- `wLastKeys` and `wCurKeys` are used for joypad input
6+
- `wGameState` will keep track what our current game state is
77

88
```rgbasm,linenos,start={{#line_no_of "" ../../galactic-armada/src/main/GalacticArmada.asm:entry-point}}
99
{{#include ../../galactic-armada/src/main/GalacticArmada.asm:entry-point}}
1010
```
1111

12-
after our "EntryPoint" label, well do the following:
12+
after our `EntryPoint` label, well do the following:
1313

14-
* set our default game state
15-
* initiate the sprite library were going to use
16-
* setup our display registers
17-
* load tile data for our font into VRAM.
14+
- set our default game state
15+
- initiate [gb-sprobj-lib](https://github.com/eievui5/gb-sprobj-lib), the sprite library we're going to use
16+
- setup our display registers
17+
- load tile data for our font into VRAM.
1818

19-
You can find the sprite library, by eivu15, [here](https://github.com/eievui5/gb-sprobj-lib) on github.
19+
The tile data we are going to load is used by all game states, which is why we'll do it here & now, for them all to use.
2020

21-
The tile data we are going to load is used by all game states, which is why we'll do it here & now, for them all to use.
21+
<img class="pixelated" src="../assets/part3/img/text-font-large.png">
2222

23-
![Untitled](../assets/part3/img/text-font-large.png)
24-
25-
This character-set is called “Area51”. It, and more 8x8 pixel fonts can ne found here: [https://damieng.com/typography/zx-origins/](https://damieng.com/typography/zx-origins/) . These 52 tiles will be placed at the beginning of our background/window VRAM region.
23+
This character-set is called “Area51”. It, and more 8x8 pixel fonts can ne found here: [https://damieng.com/typography/zx-origins/](https://damieng.com/typography/zx-origins/) . These 52 tiles will be placed at the beginning of our background/window VRAM region.
2624

2725
![TextFontDiagram.png](../assets/part3/img/TextFontDiagram.png)
2826

@@ -33,19 +31,23 @@ For the Galactic Armada space mapping, we’re going off the “text-font.png”
3331
```rgbasm,linenos,start={{#line_no_of "" ../../galactic-armada/src/main/utils/macros/text-macros.inc:charmap}}
3432
{{#include ../../galactic-armada/src/main/utils/macros/text-macros.inc:charmap}}
3533
```
34+
3635
Getting back to our entry point. Were going to wait until a vertical blank begins to do all of this. We'll also turn the LCD off before loading our tile data into VRAM..
3736

3837
```rgbasm,linenos,start={{#line_no_of "" ../../galactic-armada/src/main/GalacticArmada.asm:entry-point-end}}
3938
{{#include ../../galactic-armada/src/main/GalacticArmada.asm:entry-point-end}}
4039
```
4140

42-
> *NOTE*: Even though we haven't specifically defined a color palette. The [emulicious](https://emulicious.net/) emulator may automatically apply a cdefault color palette if in "Automatic" or "Gameboy Color" Mode
41+
::: tip
42+
43+
Even though we haven't specifically defined a color palette. The [emulicious](https://emulicious.net/) emulator may automatically apply a default color palette if in "Automatic" or "Gameboy Color" Mode
4344

44-
In the above snippet you saw use of a function called "WaitFOrOneVBLank". We've setup some vblank utility functions in the "src/main/utils/vblank-utils.asm" file:
45+
:::
4546

47+
In the above snippet you saw use of a function called `WaitFOrOneVBLank`. We've setup some vblank utility functions in the "src/main/utils/vblank-utils.asm" file:
4648

4749
```rgbasm,linenos,start={{#line_no_of "" ../../galactic-armada/src/main/utils/vblank-utils.asm:vblank-utils}}
4850
{{#include ../../galactic-armada/src/main/utils/vblank-utils.asm:vblank-utils}}
4951
```
5052

51-
In the next section, we'll go on next to setup our "NextGameState" label. Which is used for changing game states.
53+
In the next section, we'll go on next to setup our `NextGameState` label. Which is used for changing game states.

src/part3/story-screen.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ For this effect, we've defined a function in our "src/main/utils/text-utils.asm"
3838
{{#include ../../galactic-armada/src/main/utils/text-utils.asm:typewriter-effect}}
3939
```
4040

41-
We'll call the "DrawText_WithTypewriterEffect" function exactly how we called the "DrawTextTilesLoop" function. We'll pass this function which tile to start on in de, and the address of our text in hl.
41+
We'll call the `DrawText_WithTypewriterEffect` function exactly how we called the `DrawTextTilesLoop` function. We'll pass this function which tile to start on in de, and the address of our text in hl.
4242

4343
We'll do that four times for the first page, and then wait for the A button to be pressed:
4444

4545
```rgbasm,linenos,start={{#line_no_of "" ../../galactic-armada/src/main/states/story/story-state.asm:story-screen-page1}}
4646
{{#include ../../galactic-armada/src/main/states/story/story-state.asm:story-screen-page1}}
4747
```
48+
4849
Once the user presses the A button, we want to show the second page. To avoid any lingering "leftover" letters, we'll clear the background. All this function does is turn off the LCD, fill our background tilemap with the first tile, then turn back on the lcd. We've defined this function in the "src/main/utils/background.utils.asm" file:
4950

5051
```rgbasm,linenos,start={{#line_no_of "" ../../galactic-armada/src/main/utils/background-utils.asm:background-utils}}
@@ -57,7 +58,7 @@ Getting back to our Story Screen: After we've shown the first page and cleared t
5758
{{#include ../../galactic-armada/src/main/states/story/story-state.asm:story-screen-page2}}
5859
```
5960

60-
With our story full shown, we're ready to move onto the next game state: Gameplay. We'll end our "UpdateStoryState" function by updating our game state variable and jump back to the "NextGameState" label like previously discussed.
61+
With our story full shown, we're ready to move onto the next game state: Gameplay. We'll end our `UpdateStoryState` function by updating our game state variable and jump back to the `NextGameState` label like previously discussed.
6162

6263
```rgbasm,linenos,start={{#line_no_of "" ../../galactic-armada/src/main/states/story/story-state.asm:story-screen-end}}
6364
{{#include ../../galactic-armada/src/main/states/story/story-state.asm:story-screen-end}}

0 commit comments

Comments
 (0)