diff options
-rw-r--r-- | assets/madeWithUnity.gif | bin | 0 -> 16168208 bytes | |||
-rw-r--r-- | src/assets.c | 3 | ||||
-rw-r--r-- | src/assets.h | 5 | ||||
-rw-r--r-- | src/game.c | 26 | ||||
-rw-r--r-- | src/game.h | 3 |
5 files changed, 34 insertions, 3 deletions
diff --git a/assets/madeWithUnity.gif b/assets/madeWithUnity.gif Binary files differnew file mode 100644 index 0000000..5155cae --- /dev/null +++ b/assets/madeWithUnity.gif diff --git a/src/assets.c b/src/assets.c index 11225b1..a9cd789 100644 --- a/src/assets.c +++ b/src/assets.c @@ -14,7 +14,8 @@ const char textureAssetsNames[TEXTURE_ASSET_COUNT][ASSETS_NAME_MAX] = { const char animationAssetsNames[ANIMATION_ASSET_COUNT][ASSETS_NAME_MAX] = { "buttonBox.gif", "penguinLol.gif", - "clicker.gif" + "clicker.gif", + "madeWithUnity.gif" }; void loadTextures(Assets* assets) diff --git a/src/assets.h b/src/assets.h index 3d9b3eb..f101e1d 100644 --- a/src/assets.h +++ b/src/assets.h @@ -4,7 +4,7 @@ #define ASSETS_NAME_MAX 100 #define TEXTURE_ASSET_COUNT 7 -#define ANIMATION_ASSET_COUNT 3 +#define ANIMATION_ASSET_COUNT 4 #ifndef ASSETS_H #define ASSETS_H @@ -28,7 +28,8 @@ enum { BUTTON_BOX_ANIMATION, PENGUIN_LOL_ANIMATION, - CLICKER_ANIMATION + CLICKER_ANIMATION, + MADE_WITH_UNITY_ANIMATION // To trick the teacher into think its a unity game. }; typedef struct Assets { @@ -23,10 +23,34 @@ void initGame(Game* game) game->screenTexture = LoadRenderTexture(WINDOW_WIDTH, WINDOW_HEIGHT); game->stones = 0; + + game->madeWithUnity = createAnimation(&game->assets.animations[MADE_WITH_UNITY_ANIMATION], 0.2); + game->madeWithUnity.repeat = false; + playAnimation(&game->madeWithUnity); } void updateGame(Game* game) { + if (game->madeWithUnity.playing) + { + runAnimation(&game->madeWithUnity); + + BeginDrawing(); + + DrawTexturePro( + game->madeWithUnity.texture, + (Rectangle){0.0, 0.0, game->madeWithUnity.width, game->madeWithUnity.height}, + (Rectangle){0.0, 0.0, GetScreenWidth(), GetScreenHeight()}, + Vector2Zero(), + 0.0, + WHITE + ); + + EndDrawing(); + + return; + } + // Draw screen. BeginTextureMode(game->screenTexture); @@ -67,5 +91,7 @@ void closeGame(Game* game) closeClickies(&game->clickies); UnloadRenderTexture(game->screenTexture); + closeAnimation(&game->madeWithUnity); + CloseWindow(); } @@ -3,6 +3,7 @@ #include "gameScreen.h" #include "assets.h" #include "clicky.h" +#include "animation.h" #ifndef GAME_H #define GAME_H @@ -25,6 +26,8 @@ typedef struct Game { // Wacky little render texture to make it look more like a unity game lmao. RenderTexture screenTexture; + Animation madeWithUnity; + int stones; } Game; |