examples: Translate asset and variable names to English

This commit is contained in:
Antonio Niño Díaz 2023-05-21 21:11:40 +01:00
parent 498a0a2464
commit d923bbec50
61 changed files with 228 additions and 228 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
grit puntero.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
grit pointer.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
for file in *.bin; do
mv -- "$file" "${file%.bin}"

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -44,8 +44,8 @@ int main(int argc, char **argv)
NF_LoadTiledBg("bg/ppc_bg", "bg3", 512, 512);
// Load sprite files from NitroFS
NF_LoadSpriteGfx("sprite/puntero", 0, 8, 8);
NF_LoadSpritePal("sprite/puntero", 0);
NF_LoadSpriteGfx("sprite/pointer", 0, 8, 8);
NF_LoadSpritePal("sprite/pointer", 0);
// Load collision map files from NitroFS
NF_LoadCollisionBg("maps/ppc_cmap", 0, 512, 512);

View File

@ -1,6 +1,6 @@
#!/bin/sh
grit puntero.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
grit pointer.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
for file in *.bin; do
mv -- "$file" "${file%.bin}"

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -51,8 +51,8 @@ int main(int argc, char **argv)
NF_LoadTiledBg("bg/colmap", "boxes", 768, 512);
// Load sprite files from NitroFS
NF_LoadSpriteGfx("sprite/puntero", 0, 8, 8);
NF_LoadSpritePal("sprite/puntero", 0);
NF_LoadSpriteGfx("sprite/pointer", 0, 8, 8);
NF_LoadSpritePal("sprite/pointer", 0);
// Load text font files from NitroFS
NF_LoadTextFont("fnt/default", "normal", 256, 256, 0);

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -1,6 +1,6 @@
#!/bin/sh
grit bola.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
grit ball.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
for file in *.bin; do
mv -- "$file" "${file%.bin}"

View File

@ -56,8 +56,8 @@ int main(int argc, char **argv)
NF_Load8bitsBg("bg/img8b_2", 1);
// Load sprite files from NitroFS
NF_LoadSpriteGfx("spr/bola", 0, 32, 32);
NF_LoadSpritePal("spr/bola", 0);
NF_LoadSpriteGfx("spr/ball", 0, 32, 32);
NF_LoadSpritePal("spr/ball", 0);
// Create bottom screen background
NF_CreateTiledBg(0, 3, "nfl");
@ -77,18 +77,18 @@ int main(int argc, char **argv)
srand(time(NULL));
// State of the balls
s16 bola_x[32];
s16 bola_y[32];
s8 bola_spx[32];
s8 bola_spy[32];
s16 ball_x[32];
s16 ball_y[32];
s8 ball_spx[32];
s8 ball_spy[32];
for (int n = 0; n < 32; n++)
{
bola_x[n] = rand() % 223;
bola_y[n] = rand() % 159;
bola_spx[n] = (rand() % 3) + 1;
bola_spy[n] = (rand() % 3) + 1;
NF_CreateSprite(1, n, 0, 0, bola_x[n], bola_y[n]);
ball_x[n] = rand() % 223;
ball_y[n] = rand() % 159;
ball_spx[n] = (rand() % 3) + 1;
ball_spy[n] = (rand() % 3) + 1;
NF_CreateSprite(1, n, 0, 0, ball_x[n], ball_y[n]);
NF_SpriteLayer(1, n, 3);
}
@ -138,15 +138,15 @@ int main(int argc, char **argv)
// Move the sprites
for (int n = 0; n < 32; n++)
{
bola_x[n] += bola_spx[n];
if ((bola_x[n] < 0) || (bola_x[n] > 223))
bola_spx[n] *= -1;
ball_x[n] += ball_spx[n];
if ((ball_x[n] < 0) || (ball_x[n] > 223))
ball_spx[n] *= -1;
bola_y[n] += bola_spy[n];
if ((bola_y[n] < 0) || (bola_y[n] > 159))
bola_spy[n] *= -1;
ball_y[n] += ball_spy[n];
if ((ball_y[n] < 0) || (ball_y[n] > 159))
ball_spy[n] *= -1;
NF_MoveSprite(1, n, bola_x[n], bola_y[n]);
NF_MoveSprite(1, n, ball_x[n], ball_y[n]);
}
// Update OAM array

View File

@ -13,9 +13,9 @@
#include <nf_lib.h>
// Variables
u16 mapa[32][24]; // Almacena el mapa
s16 bgx[192]; // Posicion X de cada linea
s8 i[192]; // Control de movimiento de cada linea
u16 mapa[32][24]; // Holds the map
s16 bgx[192]; // Horizontal scroll of each line
s8 i[192]; // Scroll speed of each line
// Function that runs after a scanline is drawn. By modifying the values of the
// scroll registers it's possible to add a wave effect.

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,7 +1,7 @@
#!/bin/sh
grit bola.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
grit personaje.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
grit ball.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
grit character.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
for file in *.bin; do
mv -- "$file" "${file%.bin}"

View File

@ -46,22 +46,22 @@ int main(int argc, char **argv)
// Load background files from NitroFS
NF_LoadTiledBg("bg/nfl", "nfl", 256, 256);
NF_LoadTiledBg("bg/bg3", "capa_3", 256, 256);
NF_LoadTiledBg("bg/bg2", "capa_2", 1024, 256);
NF_LoadTiledBg("bg/bg3", "layer_3", 256, 256);
NF_LoadTiledBg("bg/bg2", "layer_2", 1024, 256);
// Load sprite files from NitroFS
NF_LoadSpriteGfx("sprite/personaje", 0, 64, 64);
NF_LoadSpritePal("sprite/personaje", 0);
NF_LoadSpriteGfx("sprite/character", 0, 64, 64);
NF_LoadSpritePal("sprite/character", 0);
NF_LoadSpriteGfx("sprite/bola", 1, 32, 32);
NF_LoadSpritePal("sprite/bola", 1);
NF_LoadSpriteGfx("sprite/ball", 1, 32, 32);
NF_LoadSpritePal("sprite/ball", 1);
// Create top screen background
NF_CreateTiledBg(0, 3, "nfl");
// Create bottom screen backgrounds
NF_CreateTiledBg(1, 3, "capa_3");
NF_CreateTiledBg(1, 2, "capa_2");
NF_CreateTiledBg(1, 3, "layer_3");
NF_CreateTiledBg(1, 2, "layer_2");
// Transfer the required sprites to VRAM
NF_VramSpriteGfx(1, 0, 0, true); // Ball: Keep all frames in VRAM
@ -89,65 +89,65 @@ int main(int argc, char **argv)
s8 alpha_inc = 1;
// Setup character sprite
s16 pj_x = 0;
s16 pj_y = 127;
u8 pj_frame = 0;
u8 pj_anim = 0;
s8 pj_speed = 1;
NF_CreateSprite(1, 0, 0, 0, pj_x, pj_y);
s16 char_x = 0;
s16 char_y = 127;
u8 char_frame = 0;
u8 char_anim = 0;
s8 char_speed = 1;
NF_CreateSprite(1, 0, 0, 0, char_x, char_y);
// Setup ball sprites
s16 bola_x[32];
s16 bola_y[32];
s8 bola_spx[32];
s8 bola_spy[32];
s16 ball_x[32];
s16 ball_y[32];
s8 ball_spx[32];
s8 ball_spy[32];
for (int n = 0; n < 32; n++)
{
bola_x[n] = rand() % 223;
bola_y[n] = rand() % 159;
bola_spx[n] = (rand() % 3) + 1;
bola_spy[n] = (rand() % 3) + 1;
NF_CreateSprite(0, n, 0, 0, bola_x[n], bola_y[n]);
ball_x[n] = rand() % 223;
ball_y[n] = rand() % 159;
ball_spx[n] = (rand() % 3) + 1;
ball_spy[n] = (rand() % 3) + 1;
NF_CreateSprite(0, n, 0, 0, ball_x[n], ball_y[n]);
}
while (1)
{
// Move character
pj_x += pj_speed;
if ((pj_x < 0) || (pj_x > 191))
char_x += char_speed;
if ((char_x < 0) || (char_x > 191))
{
pj_speed *= -1;
if (pj_speed > 0)
char_speed *= -1;
if (char_speed > 0)
NF_HflipSprite(1, 0, false);
else
NF_HflipSprite(1, 0, true);
}
NF_MoveSprite(1, 0, pj_x, pj_y);
NF_MoveSprite(1, 0, char_x, char_y);
// Animate character
pj_anim++;
if (pj_anim > 5)
char_anim++;
if (char_anim > 5)
{
pj_anim = 0;
pj_frame++;
if (pj_frame > 11)
pj_frame = 0;
NF_SpriteFrame(1, 0, pj_frame);
char_anim = 0;
char_frame++;
if (char_frame > 11)
char_frame = 0;
NF_SpriteFrame(1, 0, char_frame);
}
// Move balls
for (int n = 0; n < 32; n++)
{
bola_x[n] += bola_spx[n];
if ((bola_x[n] < 0) || (bola_x[n] > 223))
bola_spx[n] *= -1;
ball_x[n] += ball_spx[n];
if ((ball_x[n] < 0) || (ball_x[n] > 223))
ball_spx[n] *= -1;
bola_y[n] += bola_spy[n];
if ((bola_y[n] < 0) || (bola_y[n] > 159))
bola_spy[n] *= -1;
ball_y[n] += ball_spy[n];
if ((ball_y[n] < 0) || (ball_y[n] > 159))
ball_spy[n] *= -1;
NF_MoveSprite(0, n, bola_x[n], bola_y[n]);
NF_MoveSprite(0, n, ball_x[n], ball_y[n]);
// Fake alpha effect in the last 15 balls. This is done by showing
// the balls every other frame. This only looks fine in old LCD

View File

@ -0,0 +1,4 @@
The original animation belongs to Navy Wars (C) 2009 NightFox & Co.
It is licensed under a Creative Commons license, you must credit the game and
the original authors if you use it in your own project.

View File

@ -1,3 +0,0 @@
La animacion original pertenece a Navy Wars (cc) 2009 NightFox & Co.
Bajo licencia Creative commons, si usas esta imagen, debes dar credito
del Juego y los autores originales de donde procede.

View File

@ -1,18 +0,0 @@
Se deben de cortar los tiles de cada frame de la animacion de izquierda a derecha
y de arriba a abajo, poniendolos todos en una imagen de manera consecutiva.
Si el frame es de 4x4 tiles en un documento de 32x256 pixeles por ejemplo:
[01][02][03][04]
[05][05][07][07]
[09][10][11][12]
[13][14][15][16]
[..][..][..][..]
En el documento preparado para la animacion cuyo tamaño seria de 256x256 pixeles
los colorariamos de esta manera:
[01][02][03][04][05][05][07][07][09][10][11][12][13][14][15][16][..][..][..][..]

View File

@ -0,0 +1,17 @@
You must place the tiles of each frame of the animation from left to right, and
from up to down, placing them in an image one after the other.
If the size of each frame is 4x4 tiles in a 32x256 pixel image, for example:
[01][02][03][04]
[05][05][07][07]
[09][10][11][12]
[13][14][15][16]
[..][..][..][..]
In the final image for the animation, of size 256x256 pixels, they would be
placed this way:
[01][02][03][04][05][05][07][07][09][10][11][12][13][14][15][16][..][..][..][..]

View File

@ -39,19 +39,19 @@ int main(int argc, char **argv)
// Load background files from NitroFS
NF_LoadTiledBg("bg/nfl", "nfl", 256, 256);
NF_LoadTiledBg("bg/bg3", "capa_3", 256, 256);
NF_LoadTiledBg("bg/bg2", "capa_2", 1024, 256);
NF_LoadTiledBg("bg/bg1", "capa_1", 1536, 256);
NF_LoadTiledBg("bg/bg0", "capa_0", 2048, 256);
NF_LoadTiledBg("bg/bg3", "layer_3", 256, 256);
NF_LoadTiledBg("bg/bg2", "layer_2", 1024, 256);
NF_LoadTiledBg("bg/bg1", "layer_1", 1536, 256);
NF_LoadTiledBg("bg/bg0", "layer_0", 2048, 256);
// Create top screen background
NF_CreateTiledBg(0, 3, "nfl");
// Create bottom screen backgrounds
NF_CreateTiledBg(1, 3, "capa_3");
NF_CreateTiledBg(1, 2, "capa_2");
NF_CreateTiledBg(1, 1, "capa_1");
NF_CreateTiledBg(1, 0, "capa_0");
NF_CreateTiledBg(1, 3, "layer_3");
NF_CreateTiledBg(1, 2, "layer_2");
NF_CreateTiledBg(1, 1, "layer_1");
NF_CreateTiledBg(1, 0, "layer_0");
// Variables
s16 bg_x[4] = { 0, 0, 0, 0 };

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -1,6 +1,6 @@
#!/bin/sh
grit bola.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
grit ball.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
for file in *.bin; do
mv -- "$file" "${file%.bin}"

View File

@ -66,8 +66,8 @@ int main(int argc, char **argv)
NF_Load8bitsBg("bmp/img8b_2", 1);
// Load sprite files from NitroFS
NF_LoadSpriteGfx("sprite/bola", 0, 32, 32);
NF_LoadSpritePal("sprite/bola", 0);
NF_LoadSpriteGfx("sprite/ball", 0, 32, 32);
NF_LoadSpritePal("sprite/ball", 0);
// Create bottom screen background
NF_CreateTiledBg(1, 0, "tiled_bg");
@ -107,19 +107,19 @@ int main(int argc, char **argv)
NF_VramSpritePal(1, 0, 0);
// Setup and create ball sprites
s16 bola_x[32];
s16 bola_y[32];
s8 bola_spx[32];
s8 bola_spy[32];
s16 ball_x[32];
s16 ball_y[32];
s8 ball_spx[32];
s8 ball_spy[32];
for (int n = 0; n < 32; n++)
{
bola_x[n] = rand() % 223;
bola_y[n] = rand() % 159;
bola_spx[n] = (rand() % 3) + 1;
bola_spy[n] = (rand() % 3) + 1;
NF_CreateSprite(0, n, 0, 0, bola_x[n], bola_y[n]);
NF_CreateSprite(1, n, 0, 0, bola_x[n], bola_y[n]);
ball_x[n] = rand() % 223;
ball_y[n] = rand() % 159;
ball_spx[n] = (rand() % 3) + 1;
ball_spy[n] = (rand() % 3) + 1;
NF_CreateSprite(0, n, 0, 0, ball_x[n], ball_y[n]);
NF_CreateSprite(1, n, 0, 0, ball_x[n], ball_y[n]);
NF_SpriteLayer(0, n, 3);
NF_SpriteLayer(1, n, 3);
}
@ -129,16 +129,16 @@ int main(int argc, char **argv)
// Move balls
for (int n = 0; n < 32; n++)
{
bola_x[n] += bola_spx[n];
if ((bola_x[n] < 0) || (bola_x[n] > 223))
bola_spx[n] *= -1;
ball_x[n] += ball_spx[n];
if ((ball_x[n] < 0) || (ball_x[n] > 223))
ball_spx[n] *= -1;
bola_y[n] += bola_spy[n];
if ((bola_y[n] < 0) || (bola_y[n] > 159))
bola_spy[n] *= -1;
ball_y[n] += ball_spy[n];
if ((ball_y[n] < 0) || (ball_y[n] > 159))
ball_spy[n] *= -1;
NF_MoveSprite(0, n, bola_x[n], bola_y[n]);
NF_MoveSprite(1, n, bola_x[n], bola_y[n]);
NF_MoveSprite(0, n, ball_x[n], ball_y[n]);
NF_MoveSprite(1, n, ball_x[n], ball_y[n]);
}
// Update OAM array

View File

@ -80,7 +80,7 @@ int main(int argc, char **argv)
myvar++;
char mytext[32];
snprintf(mytext, sizeof(mytext), "Contador: %lu", myvar);
snprintf(mytext, sizeof(mytext), "Counter: %lu", myvar);
NF_WriteText(0, 0, 1, 5, mytext);
NF_WriteText(0, 1, 1, 5, mytext);
NF_WriteText(0, 2, 1, 5, mytext);

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,7 +1,7 @@
#!/bin/sh
grit bola.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
grit personaje.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
grit ball.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
grit character.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
for file in *.bin; do
mv -- "$file" "${file%.bin}"

View File

@ -46,22 +46,22 @@ int main(int argc, char **argv)
// Load background files from NitroFS
NF_LoadTiledBg("bg/nfl", "nfl", 256, 256);
NF_LoadTiledBg("bg/bg3", "capa_3", 256, 256);
NF_LoadTiledBg("bg/bg2", "capa_2", 1024, 256);
NF_LoadTiledBg("bg/bg3", "layer_3", 256, 256);
NF_LoadTiledBg("bg/bg2", "layer_2", 1024, 256);
// Load sprite files from NitroFS
NF_LoadSpriteGfx("sprite/personaje", 0, 64, 64);
NF_LoadSpritePal("sprite/personaje", 0);
NF_LoadSpriteGfx("sprite/character", 0, 64, 64);
NF_LoadSpritePal("sprite/character", 0);
NF_LoadSpriteGfx("sprite/bola", 1, 32, 32);
NF_LoadSpritePal("sprite/bola", 1);
NF_LoadSpriteGfx("sprite/ball", 1, 32, 32);
NF_LoadSpritePal("sprite/ball", 1);
// Create top screen background
NF_CreateTiledBg(0, 3, "nfl");
// Create bottom screen backgrounds
NF_CreateTiledBg(1, 3, "capa_3");
NF_CreateTiledBg(1, 2, "capa_2");
NF_CreateTiledBg(1, 3, "layer_3");
NF_CreateTiledBg(1, 2, "layer_2");
// Transfer the required sprites to VRAM
NF_VramSpriteGfx(1, 0, 0, true); // Ball: Keep all frames in VRAM
@ -71,65 +71,65 @@ int main(int argc, char **argv)
NF_VramSpritePal(0, 1, 0);
// Setup character sprite
s16 pj_x = 0;
s16 pj_y = 127;
u8 pj_frame = 0;
u8 pj_anim = 0;
s8 pj_speed = 1;
NF_CreateSprite(1, 0, 0, 0, pj_x, pj_y);
s16 char_x = 0;
s16 char_y = 127;
u8 char_frame = 0;
u8 char_anim = 0;
s8 char_speed = 1;
NF_CreateSprite(1, 0, 0, 0, char_x, char_y);
// Setup ball sprites
s16 bola_x[32];
s16 bola_y[32];
s8 bola_spx[32];
s8 bola_spy[32];
s16 ball_x[32];
s16 ball_y[32];
s8 ball_spx[32];
s8 ball_spy[32];
for (int n = 0; n < 32; n++)
{
bola_x[n] = rand() % 223;
bola_y[n] = rand() % 159;
bola_spx[n] = (rand() % 3) + 1;
bola_spy[n] = (rand() % 3) + 1;
NF_CreateSprite(0, n, 0, 0, bola_x[n], bola_y[n]);
ball_x[n] = rand() % 223;
ball_y[n] = rand() % 159;
ball_spx[n] = (rand() % 3) + 1;
ball_spy[n] = (rand() % 3) + 1;
NF_CreateSprite(0, n, 0, 0, ball_x[n], ball_y[n]);
}
while (1)
{
// Move character
pj_x += pj_speed;
if ((pj_x < 0) || (pj_x > 191))
char_x += char_speed;
if ((char_x < 0) || (char_x > 191))
{
pj_speed *= -1;
if (pj_speed > 0)
char_speed *= -1;
if (char_speed > 0)
NF_HflipSprite(1, 0, false);
else
NF_HflipSprite(1, 0, true);
}
NF_MoveSprite(1, 0, pj_x, pj_y);
NF_MoveSprite(1, 0, char_x, char_y);
// Animate character
pj_anim++;
if (pj_anim > 5)
char_anim++;
if (char_anim > 5)
{
pj_anim = 0;
pj_frame++;
if (pj_frame > 11)
pj_frame = 0;
NF_SpriteFrame(1, 0, pj_frame);
char_anim = 0;
char_frame++;
if (char_frame > 11)
char_frame = 0;
NF_SpriteFrame(1, 0, char_frame);
}
// Move balls
for (int n = 0; n < 32; n++)
{
bola_x[n] += bola_spx[n];
if ((bola_x[n] < 0) || (bola_x[n] > 223))
bola_spx[n] *= -1;
ball_x[n] += ball_spx[n];
if ((ball_x[n] < 0) || (ball_x[n] > 223))
ball_spx[n] *= -1;
bola_y[n] += bola_spy[n];
if ((bola_y[n] < 0) || (bola_y[n] > 159))
bola_spy[n] *= -1;
ball_y[n] += ball_spy[n];
if ((ball_y[n] < 0) || (ball_y[n] > 159))
ball_spy[n] *= -1;
NF_MoveSprite(0, n, bola_x[n], bola_y[n]);
NF_MoveSprite(0, n, ball_x[n], ball_y[n]);
}
// Update OAM array

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,7 +1,7 @@
#!/bin/sh
grit bola.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
grit personaje.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
grit ball.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
grit character.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
for file in *.bin; do
mv -- "$file" "${file%.bin}"

View File

@ -46,22 +46,22 @@ int main(int argc, char **argv)
// Load background files from NitroFS
NF_LoadTiledBg("bg/nfl", "nfl", 256, 256);
NF_LoadTiledBg("bg/bg3", "capa_3", 256, 256);
NF_LoadTiledBg("bg/bg2", "capa_2", 1024, 256);
NF_LoadTiledBg("bg/bg3", "layer_3", 256, 256);
NF_LoadTiledBg("bg/bg2", "layer_2", 1024, 256);
// Load sprite files from NitroFS
NF_LoadSpriteGfx("sprite/personaje", 0, 64, 64);
NF_LoadSpritePal("sprite/personaje", 0);
NF_LoadSpriteGfx("sprite/character", 0, 64, 64);
NF_LoadSpritePal("sprite/character", 0);
NF_LoadSpriteGfx("sprite/bola", 1, 32, 32);
NF_LoadSpritePal("sprite/bola", 1);
NF_LoadSpriteGfx("sprite/ball", 1, 32, 32);
NF_LoadSpritePal("sprite/ball", 1);
// Create top screen background
NF_CreateTiledBg(0, 3, "nfl");
// Create bottom screen backgrounds
NF_CreateTiledBg(1, 3, "capa_3");
NF_CreateTiledBg(1, 2, "capa_2");
NF_CreateTiledBg(1, 3, "layer_3");
NF_CreateTiledBg(1, 2, "layer_2");
// Transfer the required sprites to VRAM
NF_VramSpriteGfx(1, 0, 0, true); // Ball: Keep all frames in VRAM
@ -71,26 +71,26 @@ int main(int argc, char **argv)
NF_VramSpritePal(0, 1, 0);
// Setup character sprite
s16 pj_x = 0;
s16 pj_y = 127;
u8 pj_frame = 0;
u8 pj_anim = 0;
s8 pj_speed = 1;
NF_CreateSprite(1, 0, 0, 0, pj_x, pj_y);
s16 char_x = 0;
s16 char_y = 127;
u8 char_frame = 0;
u8 char_anim = 0;
s8 char_speed = 1;
NF_CreateSprite(1, 0, 0, 0, char_x, char_y);
// Setup ball sprites
s16 bola_x[32];
s16 bola_y[32];
s8 bola_spx[32];
s8 bola_spy[32];
s16 ball_x[32];
s16 ball_y[32];
s8 ball_spx[32];
s8 ball_spy[32];
for (int n = 0; n < 32; n++)
{
bola_x[n] = rand() % 223;
bola_y[n] = rand() % 159;
bola_spx[n] = (rand() % 3) + 1;
bola_spy[n] = (rand() % 3) + 1;
NF_CreateSprite(0, n, 0, 0, bola_x[n], bola_y[n]);
ball_x[n] = rand() % 223;
ball_y[n] = rand() % 159;
ball_spx[n] = (rand() % 3) + 1;
ball_spy[n] = (rand() % 3) + 1;
NF_CreateSprite(0, n, 0, 0, ball_x[n], ball_y[n]);
}
// Palette color cycle speed
@ -152,42 +152,42 @@ int main(int argc, char **argv)
}
// Move character
pj_x += pj_speed;
if ((pj_x < 0) || (pj_x > 191))
char_x += char_speed;
if ((char_x < 0) || (char_x > 191))
{
pj_speed *= -1;
char_speed *= -1;
if (pj_speed > 0)
if (char_speed > 0)
NF_HflipSprite(1, 0, false);
else
NF_HflipSprite(1, 0, true);
}
NF_MoveSprite(1, 0, pj_x, pj_y);
NF_MoveSprite(1, 0, char_x, char_y);
// Animate character
pj_anim++;
if (pj_anim > 5)
char_anim++;
if (char_anim > 5)
{
pj_anim = 0;
pj_frame++;
if (pj_frame > 11)
pj_frame = 0;
char_anim = 0;
char_frame++;
if (char_frame > 11)
char_frame = 0;
NF_SpriteFrame(1, 0, pj_frame);
NF_SpriteFrame(1, 0, char_frame);
}
// Move balls
for (int n = 0; n < 32; n++)
{
bola_x[n] += bola_spx[n];
if ((bola_x[n] < 0) || (bola_x[n] > 223))
bola_spx[n] *= -1;
ball_x[n] += ball_spx[n];
if ((ball_x[n] < 0) || (ball_x[n] > 223))
ball_spx[n] *= -1;
bola_y[n] += bola_spy[n];
if ((bola_y[n] < 0) || (bola_y[n] > 159))
bola_spy[n] *= -1;
ball_y[n] += ball_spy[n];
if ((ball_y[n] < 0) || (ball_y[n] > 159))
ball_spy[n] *= -1;
NF_MoveSprite(0, n, bola_x[n], bola_y[n]);
NF_MoveSprite(0, n, ball_x[n], ball_y[n]);
}
// Update OAM array

View File

@ -1,6 +1,6 @@
#!/bin/sh
grit puntero.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
grit pointer.png -ftb -fh! -gTFF00FF -gt -gB8 -m!
for file in *.bin; do
mv -- "$file" "${file%.bin}"

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -48,8 +48,8 @@ int main(int argc, char **argv)
NF_LoadTiledBg("bg/colmap", "boxes", 768, 512);
// Load sprite files from NitroFS
NF_LoadSpriteGfx("sprite/puntero", 0, 8, 8);
NF_LoadSpritePal("sprite/puntero", 0);
NF_LoadSpriteGfx("sprite/pointer", 0, 8, 8);
NF_LoadSpritePal("sprite/pointer", 0);
// Load text font files from NitroFS
NF_LoadTextFont("fnt/default", "normal", 256, 256, 0);

View File

@ -59,8 +59,8 @@ int main(int argc, char **argv)
s16 bottom = 0;
u16 mini_x = 0;
u16 mini_y = 0;
u16 desp_x = 0;
u16 desp_y = 0;
u16 disp_x = 0;
u16 disp_y = 0;
u32 scr_idx = 0;
u32 img_idx = 0;
@ -80,13 +80,13 @@ int main(int argc, char **argv)
{
mini_x = right;
mini_y = (NF_BG16B[0].height * right) / NF_BG16B[0].width;
desp_y = (192 - mini_y) >> 1;
disp_y = (192 - mini_y) >> 1;
}
else
{
mini_x = (NF_BG16B[0].width * bottom) / NF_BG16B[0].height;
mini_y = bottom;
desp_x = (256 - mini_x) >> 1;
disp_x = (256 - mini_x) >> 1;
}
// Generate thumbnail
@ -95,7 +95,7 @@ int main(int argc, char **argv)
for (int scr_x = 0; scr_x < mini_x; scr_x++)
{
// Calculate source and destination offsets
scr_idx = ((scr_y + desp_y) << 8) + (scr_x + desp_x);
scr_idx = ((scr_y + disp_y) << 8) + (scr_x + disp_x);
img_idx = (((scr_y * NF_BG16B[0].height) / mini_y) * NF_BG16B[0].width)
+ ((scr_x * NF_BG16B[0].width) / mini_x);

View File

@ -47,7 +47,7 @@ int main(int argc, char **argv)
break;
}
while(1)
while (1)
{
swiWaitForVBlank();
}

View File

@ -77,7 +77,7 @@ int main(int argc, char **argv)
myvar++;
char mytext[32];
snprintf(mytext, sizeof(mytext), "Contador: %lu", myvar);
snprintf(mytext, sizeof(mytext), "Counter: %lu", myvar);
NF_WriteText(0, 0, 1, 5, mytext);
NF_WriteText(0, 1, 1, 5, mytext);

View File

@ -77,7 +77,7 @@ int main(int argc, char **argv)
myvar++;
char mytext[32];
snprintf(mytext, sizeof(mytext), "Contador: %lu", myvar);
snprintf(mytext, sizeof(mytext), "Counter: %lu", myvar);
NF_WriteText16(0, 0, 1, 4, mytext);
NF_WriteText16(1, 1, 1, 4, mytext);

View File

@ -215,7 +215,7 @@ int main(int argc, char **argv)
{
u8 modo = 0; // Client (1) - Server (2)
u32 contador = 0;
u32 counter = 0;
char temp[256];
bool loop = true;
bool senddata = true;
@ -267,7 +267,7 @@ int main(int argc, char **argv)
// Reset counter when the user presses X
if (keys & KEY_X)
contador = 0;
counter = 0;
// Exit if R is pressed
if (keys & KEY_R)
@ -278,7 +278,7 @@ int main(int argc, char **argv)
if (loop)
{
// Send data if the loop is active
sprintf(temp, "%05lu", contador);
sprintf(temp, "%05lu", counter);
}
else
{
@ -293,9 +293,9 @@ int main(int argc, char **argv)
// Print the received data
printf("Verificado: %s\n\n", NF_RECV_BUFFER);
// Increment counter
contador++;
if (contador > 9999)
contador = 0;
counter++;
if (counter > 9999)
counter = 0;
}
else
{