diff options
Diffstat (limited to 'Menu.cpp')
| -rw-r--r-- | Menu.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -6,6 +6,7 @@ #include "HumanPlayer.h" #include "Game.h" #include "System.h" +#include "Sprite.h" #include <Gamebuino.h> #include <Arduino.h> @@ -83,20 +84,26 @@ void MainMenu(void) GAMEBUINO_MAX_PLAYER_NAME = 10 }; + Camera cam; + char strName[GAMEBUINO_MAX_PLAYER_NAME] = {0}; /* Fill strName with default user name. */ gb.getDefaultName(strName); /* Declare 1 human player instance. */ - HumanPlayer h(strName); + HumanPlayer h(strName, cam); const struct tGameConfig c = { .pHumanPlayerData = &h, - .u8NHumanPlayers = 1 + .u8NHumanPlayers = 1, + .cam = cam }; + /* Set global camera for sprites. */ + Sprite::setCamera(&c.cam); + /* Initialize game with defined configuration. */ Game(c); } |
