forked from udacity/CppND-Capstone-Snake-Game
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
22 lines (20 loc) · 731 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include "controller.h"
#include "game.h"
#include "renderer.h"
int main() {
constexpr std::size_t kFramesPerSecond{60};
constexpr std::size_t kMsPerFrame{1000 / kFramesPerSecond};
constexpr std::size_t kScreenWidth{640};
constexpr std::size_t kScreenHeight{640};
constexpr std::size_t kGridWidth{32};
constexpr std::size_t kGridHeight{32};
Renderer renderer(kScreenWidth, kScreenHeight, kGridWidth, kGridHeight);
Controller controller;
Game game(kGridWidth, kGridHeight);
game.Run(controller, renderer, kMsPerFrame);
std::cout << "Game has terminated successfully!\n";
std::cout << "Score: " << game.GetScore() << "\n";
std::cout << "Size: " << game.GetSize() << "\n";
return 0;
}