Skip to content

Commit fc0f2a0

Browse files
Les-Wetwilkersonrdevonavivace
authored
Add title screen section to Part II (#137)
* Adds title screen section to tutorial * Make title screen code buildable * Change to Memcopy usage * Added title screen text and assets --------- Co-authored-by: Devon Wilkerson <wilkersonrdevon@gmail.com> Co-authored-by: Antonio Vivace <avivace4@gmail.com>
1 parent f50d351 commit fc0f2a0

File tree

8 files changed

+1590
-0
lines changed

8 files changed

+1590
-0
lines changed

src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
- [Input](part2/input.md)
3030
- [Collision](part2/collision.md)
3131
- [Bricks](part2/bricks.md)
32+
- [Title Screen](part2/title-screen.md)
3233
- [Decimal Numbers](part2/bcd.md)
3334
- [Work in progress](part2/wip.md)
3435

12.6 KB
Loading

src/part2/title-screen.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Title Screen
2+
3+
Let's make our game more official and give it a title screen! First, copy the tileset and tilemap found [here](https://github.com/gbdev/gb-asm-tutorial/raw/master/unbricked/title-screen/tilemap-titlescreen.asm) and paste it at the end of your code. This will make a title screen that looks like so:
4+
5+
![Title Screen](../assets/part2/img/title-screen.png)
6+
7+
Then copy and paste the following after waiting for VBlank:
8+
9+
```rgbasm,linenos,start={{#line_no_of "" ../../unbricked/title-screen/main.asm:title_screen}}
10+
{{#include ../../unbricked/title-screen/main.asm:title_screen}}
11+
```
12+
Note that we are using our `Memcopy` function from the [Functions](./functions.md) lesson! Isn't it handy to have reusable code? We are also using our `UpdateKeys` function from the [Input](./input.md) lesson to determine when to stop displaying the title screen and move on to the game itself. To do so, we loop until the start button has been pressed.
13+
14+
And just like that we have ourselves a title screen!

unbricked/title-screen/build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
rgbasm -o main.o main.asm
4+
rgbasm -o input.o input.asm
5+
rgblink -o unbricked.gb main.o input.o
6+
rgbfix -v -p 0xFF unbricked.gb

0 commit comments

Comments
 (0)