0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-12 15:53:42 +00:00

spritesheets and correct game.cpp

This commit is contained in:
ineslelin 2024-01-23 22:26:26 +01:00
parent 552168dab3
commit 76f4ae79ed
3 changed files with 1 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -69,7 +69,7 @@ void Game::init(const char* title, int xpos, int ypos, int width, int height, bo
//ecs implementation //ecs implementation
player.addComponent<TransformComponent>(0,0,2); //posx, posy, scale player.addComponent<TransformComponent>(0,0,2); //posx, posy, scale
player.addComponent<SpriteComponent>("assets/chicken_neutral_knight.png", true); //adds sprite (32x32px), path needed player.addComponent<SpriteComponent>("assets/chicken_knight_spritesheet.png", true); //adds sprite (32x32px), path needed
player.addComponent<KeyboardController>(SDL_SCANCODE_W, SDL_SCANCODE_S, SDL_SCANCODE_A, SDL_SCANCODE_D);//custom keycontrols can be added player.addComponent<KeyboardController>(SDL_SCANCODE_W, SDL_SCANCODE_S, SDL_SCANCODE_A, SDL_SCANCODE_D);//custom keycontrols can be added
player.addComponent<ColliderComponent>("player"); //adds tag (for further use, reference tag) player.addComponent<ColliderComponent>("player"); //adds tag (for further use, reference tag)
player.addGroup(GROUP_PLAYERS); //tell programm what group it belongs to for rendering order player.addGroup(GROUP_PLAYERS); //tell programm what group it belongs to for rendering order