This commit is contained in:
breadone 2023-03-07 15:20:17 +13:00
parent c81f6a200a
commit 8470905df9
3 changed files with 51 additions and 58 deletions

View File

@ -10,7 +10,6 @@ big6.png
big7.png
big8.png
big9.png
big10.png
bg.png
floor.png
logo.png

Binary file not shown.

View File

@ -84,74 +84,68 @@ void moveSprite(Sprite *spr, s16 dx, s16 dy) {
int main(int argc, char* argv[]) {
// Init libs
romfsInit();
gfxInitDefault();
C3D_Init(C3D_DEFAULT_CMDBUF_SIZE);
C2D_Init(C2D_DEFAULT_MAX_OBJECTS);
C2D_Prepare();
consoleInit(GFX_BOTTOM, NULL);
// Init libs
romfsInit();
gfxInitDefault();
C3D_Init(C3D_DEFAULT_CMDBUF_SIZE);
C2D_Init(C2D_DEFAULT_MAX_OBJECTS);
C2D_Prepare();
consoleInit(GFX_BOTTOM, NULL);
// Create screens
C3D_RenderTarget* top = C2D_CreateScreenTarget(GFX_TOP, GFX_LEFT);
// C3D_RenderTarget* bottom = C2D_CreateScreenTarget(GFX_BOTTOM, GFX_LEFT);
// Create screens
C3D_RenderTarget* top = C2D_CreateScreenTarget(GFX_TOP, GFX_LEFT);
// Load graphics
spriteSheet = C2D_SpriteSheetLoad("romfs:/gfx/sprites.t3x");
if (!spriteSheet) {
printf("No");
// svcBreak(USERBREAK_PANIC);
}
// Load graphics
spriteSheet = C2D_SpriteSheetLoad("romfs:/gfx/sprites.t3x");
if (!spriteSheet) {
printf("No");
// svcBreak(USERBREAK_PANIC);
}
// Initialize sprites
initSprites();
// Initialize sprites
initSprites();
// score sprite & int
int score = 0;
Sprite scoreSprite;
// score sprite & int
int score = 0;
Sprite scoreSprite;
// Main loop
while (aptMainLoop())
{
hidScanInput();
// Main loop
while (aptMainLoop())
{
hidScanInput();
// Respond to user input
u32 kDown = hidKeysDown();
if (kDown & KEY_START)
break; // break in order to return to hbmenu
// Respond to user input
u32 kDown = hidKeysDown();
if (kDown & KEY_START)
break; // break in order to return to hbmenu
// get circlepad position
circlePosition cpos;
hidCircleRead(&cpos);
// move spr based on it
moveSprite(&sprites[0], cpos.dx, cpos.dy);
// Render the scene
C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
C2D_TargetClear(top, C2D_Color32f(0.2352941176f, 0.8392156863f, 0.8392156863f, 1.0f));
C2D_SceneBegin(top);
printf("Bird Pos: %f, %f\n", sprites[0].x, sprites[0].y);
C2D_SpriteSetPos(&sprites[12].spr, 200, 120); // center bg
C2D_DrawSprite(&sprites[12].spr);
// Render the scene
C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
C2D_TargetClear(top, C2D_Color32f(0.2352941176f, 0.8392156863f, 0.8392156863f, 1.0f));
C2D_SceneBegin(top);
C2D_DrawSprite(&sprites[0].spr);
C3D_FrameEnd(0);
C2D_DrawSprite(&sprites[0].spr);
C3D_FrameEnd(0);
// // Flush and swap framebuffers
// gfxFlushBuffers();
// gfxSwapBuffers();
// // Flush and swap framebuffers
// gfxFlushBuffers();
// gfxSwapBuffers();
// //Wait for VBlank
// gspWaitForVBlank();
}
// //Wait for VBlank
// gspWaitForVBlank();
}
// Delete graphics
C2D_SpriteSheetFree(spriteSheet);
// Delete graphics
C2D_SpriteSheetFree(spriteSheet);
// Deinit libs
C2D_Fini();
C3D_Fini();
gfxExit();
romfsExit();
return 0;
// Deinit libs
C2D_Fini();
C3D_Fini();
gfxExit();
romfsExit();
return 0;
}