MacLO/src/LevelEndScene.c
Jon Thysell eab519a40d Importing image assets from ArduLO
I've imported some of the "character" images from ArduLO, converted to
GIFs because they're easier to work with. They've been imported into a
new Bitmaps structure so they only need to be loaded once at app start.

I've also cleaned up some of the drawing code, and created a series of
helpers for dividing Rects into a 3x3 grid, to make it easier to define
the layout. I've also stubbed out "theme-support". :)
2021-11-04 19:54:28 -07:00

50 lines
1.2 KiB
C

// Copyright (c) Jon Thysell <http://jonthysell.com>
// Licensed under the MIT License.
#include "LevelEndScene.h"
void LevelEndScene_Init(GameWindow *pGameWindow)
{
}
void LevelEndScene_Draw(const GameWindow *pGameWindow, bool fullRefresh)
{
Str255 halfStarsStr;
// TODO: Proper level end
if (fullRefresh)
{
}
MoveTo(100, 100);
DrawString("\pLevel complete! Click to continue.");
MoveTo(100, 125);
DrawString("\pReceived ");
NumToString((int32_t)GameEngine_GetHalfStars(&(pGameWindow->Engine)), &halfStarsStr);
DrawString(halfStarsStr);
DrawString("\p/6 half-stars.");
MoveTo(100, 200);
DrawString("\pRetry level.");
MoveTo(350, 200);
DrawString("\pNext level.");
}
void LevelEndScene_Click(GameWindow *pGameWindow, const Point *pPosition)
{
// TODO: Proper click handling
if (pPosition->h < ((pGameWindow->Window->portRect.right - pGameWindow->Window->portRect.left) / 2))
{
GameEngine_ResetLevel(&(pGameWindow->Engine));
}
else
{
GameEngine_NextLevel(&(pGameWindow->Engine));
}
GameWindow_SetScene(pGameWindow, GameEngine_IsGameOver(&(pGameWindow->Engine)) ? GameEnd : Play);
}