init player animation

This commit is contained in:
huaqo-games
2025-03-21 12:24:01 +01:00
parent c0eb325a84
commit 4f533bc78e
3 changed files with 5 additions and 2 deletions
+2
View File
@@ -0,0 +1,2 @@
- enums for other assets
-
+1 -1
View File
@@ -60,7 +60,7 @@ void InitGame(GameState* g, Display *display){
g->textures[GRASS] = LoadTexture(g->textureAssets[GRASS].path);
g->textures[HIVE] = LoadTexture(g->textureAssets[HIVE].path);
g->player = CreatePlayer(g->textures[PLAYER], g->textureAssets[PLAYER].frameWidth, 4, 5, g->hive.position, g->textureAssets[PLAYER].rotation, 50.0f);
g->player = CreatePlayer(IDLE_DOWN, g->textures[PLAYER], g->textureAssets[PLAYER].frameWidth, 4, 5, g->hive.position, g->textureAssets[PLAYER].rotation, 50.0f);
g->flowers = CreateFlowers(g->textures[FLOWER], g->textureAssets[FLOWER].frameWidth, g->textureAssets[FLOWER].rotation, 50.0f);
g->floor = CreateFloor(g->textures[GRASS], g->textureAssets[GRASS].frameWidth);
g->hive = CreateHive(g->textures[HIVE], g->textureAssets[HIVE].frameWidth);
+2 -1
View File
@@ -23,8 +23,9 @@ typedef struct {
Physics physics;
} Player;
Player CreatePlayer(Texture2D texture, float frameWidth, int maxFrame, int framesSpeed, Vector2 startPosition, float rotation, float speed){
Player CreatePlayer(PlayerState state,Texture2D texture, float frameWidth, int maxFrame, int framesSpeed, Vector2 startPosition, float rotation, float speed){
return (Player){
.state = state,
.sprite = {
.texture = texture,
.frameSize = {frameWidth, frameWidth},