2021-10-31 22:13:51 +00:00
|
|
|
// 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 ");
|
2021-11-05 02:54:28 +00:00
|
|
|
NumToString((int32_t)GameEngine_GetHalfStars(&(pGameWindow->Engine)), &halfStarsStr);
|
2021-10-31 22:13:51 +00:00
|
|
|
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);
|
|
|
|
}
|