From e02fda5fc9f7a0896f196d4ad5abacbc8c5bf28a Mon Sep 17 00:00:00 2001 From: GBA bot Date: Sun, 2 Jan 2022 00:11:07 +0000 Subject: [PATCH] Start the sprites chapter --- book/games/pong/gfx/sprites.aseprite | Bin 0 -> 1012 bytes book/games/pong/gfx/sprites.png | Bin 0 -> 438 bytes book/games/pong/gfx/sprites.toml | 6 ++++++ book/src/SUMMARY.md | 3 ++- book/src/pong/03_sprites.md | 30 +++++++++++++++++++++++++++ book/src/pong/sprites.png | Bin 0 -> 438 bytes 6 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 book/games/pong/gfx/sprites.aseprite create mode 100644 book/games/pong/gfx/sprites.png create mode 100644 book/games/pong/gfx/sprites.toml create mode 100644 book/src/pong/03_sprites.md create mode 100644 book/src/pong/sprites.png diff --git a/book/games/pong/gfx/sprites.aseprite b/book/games/pong/gfx/sprites.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..1c5bb9dc052f49f5e4a0a086f96099deee9a4125 GIT binary patch literal 1012 zcmcJNSxgf_9EXRasbHeS1K~kgK*0nMv_|A`tAL0Qu+fkRN(c%q6+#nKuwWxcu%Nz} zSO{Xk3y2bFRS-qOArC|wzymM96ey;oS`|uZ0Ac-YQQ^f$|C{-CGdnZCZ)SJWhLE9Z zE8;)|gd$dikYu#QLLb{nmf`vzbqe`2<6KKB7XglFT*?x;B(5LN&J^{#$7RVILRuqz z8A9G?g@XFNyWnU|Ciqw)08i2ZAnmyoyy?LMM}xvZbCw%8U%#EDE(tu|6%EoQ5unG> z5YRc823N(DfTVl?^d2*T42qC;^&oh$q5+H-7lVOeLeRsDUEgWVCXgZQbL!4?uu;H{ znL3>Vjy08n&x*v%2`p{Po;!toU=!E@^x+P1SVI}UkcBBU;Rr$4K@DDzVvQIEE)anQ z6p(KT4?`?65r{NIxv@zUj{9#xf!LE{NypPfnUd2P$^RN5lw_tXjNoGihgw*Gv0k`C z9skamYlcoMJNzf@ew`oNUU$2utAtUpe@bQ|ic5+pIrho1d|Yd?INgE7u+tS!BW?Dq zIj?i|cC6c6;(w_*)!zMZ(XtEo6K%%}sMNG1-(sn4P{+F$T$OpPH^-%;XQNSV_mC?R zJrspI2#4Hr12l0$9uu?et>AgFqH&AU`jr>_^qCQ|=Bk9j{Q1tP70nrw6C>ZhRTb=? zi@#UB{UBp9$gYdCd-Bz_f%?^RWBd3sub3*@5Gv=@wKtxtOfI)BYuc^Pu3cyKiTR+< zQ+|p2G1qdrP~VePdL>-{W?DNKsG6zj;;ZNzviHFu(~sz|&6;;|ty=d*ZXOn_zn6XI zz_i$NdAq_zD-F0ilQX6%{2VxB8t9f*5BKuqef}DkM5VSxSP`im&@mN0O+Ry;`^1h-Q$Vf2)p;II>GsR+DGuO+{0tfU_G?j9=Bt stGbu1UcIrhc>a#I^vclL`rz4#gxM!Py|Hte2j0((x91&3D+LX|0JVH@d;kCd literal 0 HcmV?d00001 diff --git a/book/games/pong/gfx/sprites.png b/book/games/pong/gfx/sprites.png new file mode 100644 index 0000000000000000000000000000000000000000..9964bf0b6400be2a60e1778c6ee65dbb0f91467f GIT binary patch literal 438 zcmV;n0ZIOeP)Px$a7jc#R9J=Wm`_T>Kop0++Cq1NRTo(a*|@Qwt`yx^yn+`{=n(|3&=ZK@3A}?M zC4%!x&uJ)c;SYiN>C-J z5>yGQ1pg^PO`Z?Re>>kT#}($co&jiXw6uVr+t*0!2~_1?Yj(2dW*dOPNu-guKO;%| zx)}n{B+9(+kKp4v1d?tjlEmts2+rR|0CX1TG?KJA>ca0Vm_84O!%x8Flc*LdV?bHc zXj)O4dp&sB{{|8rkn``JAl?6w<}ir1W0Lk&CW*f;Ow$2>1o=8pFNi>rB$hoR_5^YY z<(HG3fA<7xk*5dVr!jRtkS5Oy#m$1LKKT2CVX6=QRase{KKLh?rVqvKL7qOiC-|#A g_}c?heXu6@0SQNyXlYPJ`Tzg`07*qoM6N<$g20Wxl>h($ literal 0 HcmV?d00001 diff --git a/book/games/pong/gfx/sprites.toml b/book/games/pong/gfx/sprites.toml new file mode 100644 index 00000000..39c68850 --- /dev/null +++ b/book/games/pong/gfx/sprites.toml @@ -0,0 +1,6 @@ +version = "1.0" + +[image.sprites] +filename = "sprites.png" +tile_size = "16x16" +transparent_colour = "ff0044" \ No newline at end of file diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index d6dbc84f..0b00be0d 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -9,4 +9,5 @@ - [Mac OS setup]() - [Building the game](./setup/building.md) - [Learn agb part I - pong](./pong/01_introduction.md) - - [The Gba struct](./pong/02_the_gba_struct.md) \ No newline at end of file + - [The Gba struct](./pong/02_the_gba_struct.md) + - [Sprites](./pong/03_sprites.md) \ No newline at end of file diff --git a/book/src/pong/03_sprites.md b/book/src/pong/03_sprites.md new file mode 100644 index 00000000..deb012fb --- /dev/null +++ b/book/src/pong/03_sprites.md @@ -0,0 +1,30 @@ +# Sprites + +In this section, we'll put the sprites needed for our pong game onto the screen. + +# Import the sprite + +Firstly, you're going to need to import the sprites into your project. +Save the following image into a new folder called `gfx` in your project: + +![pong sprites](sprites.png) + +This contains 5 `16x16px` sprites. +The first is the end cap for the paddle. +The second is the centre part of the paddle, which could potentially be repeated a few times. +The third until the fifth is the ball, with various squashed states. +The background is a lovely shade of `#ff0044` which we will use for the transparency. + +`agb` needs to know what the tile size is, and also what the transparent colour is so that it can properly produce data that the Game Boy Advance can understand. +So you need to create a manifest file for the image, which is declared in a toml file. + +In the same `gfx` folder as the `sprites.png` file, also create a `sprites.toml` file with the following content: + +```toml +version = "1.0" + +[image.sprites] +filename = "sprites.png" +tile_size = "16x16" +transparent_colour = "ff0044" +``` \ No newline at end of file diff --git a/book/src/pong/sprites.png b/book/src/pong/sprites.png new file mode 100644 index 0000000000000000000000000000000000000000..9964bf0b6400be2a60e1778c6ee65dbb0f91467f GIT binary patch literal 438 zcmV;n0ZIOeP)Px$a7jc#R9J=Wm`_T>Kop0++Cq1NRTo(a*|@Qwt`yx^yn+`{=n(|3&=ZK@3A}?M zC4%!x&uJ)c;SYiN>C-J z5>yGQ1pg^PO`Z?Re>>kT#}($co&jiXw6uVr+t*0!2~_1?Yj(2dW*dOPNu-guKO;%| zx)}n{B+9(+kKp4v1d?tjlEmts2+rR|0CX1TG?KJA>ca0Vm_84O!%x8Flc*LdV?bHc zXj)O4dp&sB{{|8rkn``JAl?6w<}ir1W0Lk&CW*f;Ow$2>1o=8pFNi>rB$hoR_5^YY z<(HG3fA<7xk*5dVr!jRtkS5Oy#m$1LKKT2CVX6=QRase{KKLh?rVqvKL7qOiC-|#A g_}c?heXu6@0SQNyXlYPJ`Tzg`07*qoM6N<$g20Wxl>h($ literal 0 HcmV?d00001