summaryrefslogtreecommitdiff
path: root/Menu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Menu.cpp')
-rw-r--r--Menu.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Menu.cpp b/Menu.cpp
index 9b19069..25c40aa 100644
--- a/Menu.cpp
+++ b/Menu.cpp
@@ -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);
}