init player animation
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
- enums for other assets
|
||||
-
|
||||
+1
-1
@@ -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
@@ -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},
|
||||
|
||||
Reference in New Issue
Block a user