mirror of
https://github.com/jonthysell/MacLO.git
synced 2024-11-28 03:49:36 +00:00
Light bitmaps and more sound fixes
* Adding the loading of bitmaps for the lights * Moved done sounds to start playing after the end scene has drawn
This commit is contained in:
parent
efaf627495
commit
56f52ad87c
BIN
assets/done.wav
BIN
assets/done.wav
Binary file not shown.
BIN
assets/light0.gif
Normal file
BIN
assets/light0.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 255 B |
BIN
assets/light1.gif
Normal file
BIN
assets/light1.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 139 B |
@ -13,6 +13,8 @@
|
|||||||
#define RetryButtonPictResID (NextButtonPictResID + 1)
|
#define RetryButtonPictResID (NextButtonPictResID + 1)
|
||||||
#define SoundOffPictResID (RetryButtonPictResID + 1)
|
#define SoundOffPictResID (RetryButtonPictResID + 1)
|
||||||
#define SoundOnPictResID (SoundOffPictResID + 1)
|
#define SoundOnPictResID (SoundOffPictResID + 1)
|
||||||
|
#define LightOffPictResID (SoundOnPictResID + 1)
|
||||||
|
#define LightOnPictResID (LightOffPictResID + 1)
|
||||||
|
|
||||||
#define StarRectPadding 2
|
#define StarRectPadding 2
|
||||||
|
|
||||||
@ -102,6 +104,20 @@ void Bitmaps_Init(Bitmaps *pBitmaps)
|
|||||||
{
|
{
|
||||||
ShowError("\pSound on PICT resource missing!", true);
|
ShowError("\pSound on PICT resource missing!", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load light off
|
||||||
|
pBitmaps->LightOffPict = GetPicture(LightOffPictResID);
|
||||||
|
if (pBitmaps->LightOffPict == nil)
|
||||||
|
{
|
||||||
|
ShowError("\pLight off PICT resource missing!", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load light on
|
||||||
|
pBitmaps->LightOnPict = GetPicture(LightOnPictResID);
|
||||||
|
if (pBitmaps->LightOnPict == nil)
|
||||||
|
{
|
||||||
|
ShowError("\pLight on PICT resource missing!", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bitmaps_GetNumberRect(const Bitmaps *pBitmaps, const uint32_t number, const uint8_t scale, Rect *pDestRect)
|
void Bitmaps_GetNumberRect(const Bitmaps *pBitmaps, const uint32_t number, const uint8_t scale, Rect *pDestRect)
|
||||||
|
@ -21,6 +21,8 @@ typedef struct sBitmaps
|
|||||||
PicHandle RetryButtonPict;
|
PicHandle RetryButtonPict;
|
||||||
PicHandle SoundOffPict;
|
PicHandle SoundOffPict;
|
||||||
PicHandle SoundOnPict;
|
PicHandle SoundOnPict;
|
||||||
|
PicHandle LightOffPict;
|
||||||
|
PicHandle LightOnPict;
|
||||||
} Bitmaps;
|
} Bitmaps;
|
||||||
|
|
||||||
void Bitmaps_Init(Bitmaps *pBitmaps);
|
void Bitmaps_Init(Bitmaps *pBitmaps);
|
||||||
|
@ -32,9 +32,6 @@ void GameEndScene_Init(GameWindow *pGameWindow)
|
|||||||
GetBoxRect(pContentRect, Bottom, &r);
|
GetBoxRect(pContentRect, Bottom, &r);
|
||||||
GetBoxRect(&r, Top, &r);
|
GetBoxRect(&r, Top, &r);
|
||||||
CenterRect(&r, &(pGameWindow->GameEndScene.ScoreRect));
|
CenterRect(&r, &(pGameWindow->GameEndScene.ScoreRect));
|
||||||
|
|
||||||
// Play done sound
|
|
||||||
Sounds_PlayDoneSnd(&(pGameWindow->Sounds));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameEndScene_Draw(const GameWindow *pGameWindow, bool fullRefresh)
|
void GameEndScene_Draw(const GameWindow *pGameWindow, bool fullRefresh)
|
||||||
|
@ -48,9 +48,6 @@ void LevelEndScene_Init(GameWindow *pGameWindow)
|
|||||||
|
|
||||||
GetBoxRect(pContentRect, BottomRight, &r);
|
GetBoxRect(pContentRect, BottomRight, &r);
|
||||||
CenterRect(&r, &(pGameWindow->LevelEndScene.NextButtonRect));
|
CenterRect(&r, &(pGameWindow->LevelEndScene.NextButtonRect));
|
||||||
|
|
||||||
// Play done sound
|
|
||||||
Sounds_PlayDoneSnd(&(pGameWindow->Sounds));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LevelEndScene_Draw(const GameWindow *pGameWindow, bool fullRefresh)
|
void LevelEndScene_Draw(const GameWindow *pGameWindow, bool fullRefresh)
|
||||||
@ -96,6 +93,15 @@ void LevelEndScene_Click(GameWindow *pGameWindow, const Point *pPosition)
|
|||||||
{
|
{
|
||||||
Sounds_PlayClickSnd(&(pGameWindow->Sounds));
|
Sounds_PlayClickSnd(&(pGameWindow->Sounds));
|
||||||
GameEngine_NextLevel(&(pGameWindow->Engine));
|
GameEngine_NextLevel(&(pGameWindow->Engine));
|
||||||
GameWindow_SetScene(pGameWindow, GameEngine_IsGameOver(&(pGameWindow->Engine)) ? GameEnd : Play);
|
|
||||||
|
if (GameEngine_IsGameOver(&(pGameWindow->Engine)))
|
||||||
|
{
|
||||||
|
GameWindow_SetScene(pGameWindow, GameEnd);
|
||||||
|
Sounds_PlayDoneSnd(&(pGameWindow->Sounds));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GameWindow_SetScene(pGameWindow, Play);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
src/MacLO.pi.bin
BIN
src/MacLO.pi.bin
Binary file not shown.
Binary file not shown.
@ -104,12 +104,14 @@ void PlayScene_Draw(const GameWindow *pGameWindow, bool fullRefresh)
|
|||||||
if (GameEngine_GetLight(&(pGameWindow->Engine), c, r))
|
if (GameEngine_GetLight(&(pGameWindow->Engine), c, r))
|
||||||
{
|
{
|
||||||
// Draw ON light
|
// Draw ON light
|
||||||
FillRoundRect(&lightRect, LightCornerSize, LightCornerSize, white);
|
DrawPicture(pGameWindow->Bitmaps.LightOnPict, &lightRect);
|
||||||
|
//FillRoundRect(&lightRect, LightCornerSize, LightCornerSize, white);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Draw OFF light
|
// Draw OFF light
|
||||||
FillRoundRect(&lightRect, LightCornerSize, LightCornerSize, dkGray);
|
DrawPicture(pGameWindow->Bitmaps.LightOffPict, &lightRect);
|
||||||
|
//FillRoundRect(&lightRect, LightCornerSize, LightCornerSize, dkGray);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -176,6 +178,7 @@ void PlayScene_Click(GameWindow *pGameWindow, const Point *pPosition)
|
|||||||
// Level was completed in the last click
|
// Level was completed in the last click
|
||||||
GameWindow_Draw(pGameWindow, false);
|
GameWindow_Draw(pGameWindow, false);
|
||||||
GameWindow_SetScene(pGameWindow, LevelEnd);
|
GameWindow_SetScene(pGameWindow, LevelEnd);
|
||||||
|
Sounds_PlayDoneSnd(&(pGameWindow->Sounds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (PtInRect(*pPosition, &(pGameWindow->PlayScene.HUDRect)))
|
else if (PtInRect(*pPosition, &(pGameWindow->PlayScene.HUDRect)))
|
||||||
|
Loading…
Reference in New Issue
Block a user