feat: add wake, rose, terrain, pathfinding, gameover, clouds, enemy shooting, variable bird speed refactor: some things

This commit is contained in:
2026-09-19 13:17:46 +02:00
parent c80b4887e9
commit a2ffb45fc5
49 changed files with 3002 additions and 1178 deletions
+59
View File
@@ -0,0 +1,59 @@
#include <raylib.h>
#include "appCore.h"
#include "engineAssets.h"
#include "rose.h"
#include "engineSprite.h"
const TextureAsset roseTextureAssets[ROSE_TEX_COUNT] = {{
"assets/rose.png",
2560.0f,
2560.0f,
0.0f
}};
Rose CreateRose(void){
TextureAsset roseAsset = roseTextureAssets[ROSE];
Texture2D texture = LoadTextureCached(roseAsset.path);
float frameWidth = roseAsset.frameWidth;
Vector2 frameSize = {frameWidth, frameWidth};
float rotation = roseAsset.rotation;
Rectangle sourceRec = {0.0f, 0.0f, frameWidth, frameWidth};
float destSize = GetScreenWidth() * ROSE_SCREEN_WIDTH_FRACTION;
Rectangle destRec = {GetScreenWidth() / 2, GetScreenHeight(), destSize, destSize};
Vector2 origin = {destSize / 2, destSize / 2};
Color color = WHITE;
Sprite sprite = {
.texture = texture,
.frameSize = frameSize,
.sourceRec = sourceRec,
.destRec = destRec,
.origin = origin,
.rotation = rotation,
.color = color
};
Rose rose = {
.sprite = sprite
};
return rose;
}
void UpdateRose(Rose *rose, Player *player){
float rotationSpeed = player->rotation;
if (IsGameActionDown(ACTION_TURN_LEFT)) {
rose->sprite.rotation -= rotationSpeed * GetFrameTime();
}
if (IsGameActionDown(ACTION_TURN_RIGHT)) {
rose->sprite.rotation += rotationSpeed * GetFrameTime();
}
}
void RenderRose(Rose *rose){
RenderSprite(&rose->sprite);
}