mirror of
https://github.com/dora-meowmeow/countdown-snake.git
synced 2026-02-23 04:15:23 +01:00
Changed base values
This commit is contained in:
5
main.cpp
5
main.cpp
@@ -8,6 +8,7 @@
|
|||||||
* ncurses
|
* ncurses
|
||||||
* thats it...
|
* thats it...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
@@ -51,7 +52,7 @@ struct vec2 {
|
|||||||
|
|
||||||
class Game {
|
class Game {
|
||||||
public:
|
public:
|
||||||
Game(uint16_t boardX = 40, uint16_t boardY = 60, uint16_t framesPerSec = 20)
|
Game(uint16_t boardX = 90, uint16_t boardY = 30, uint16_t framesPerSec = 10)
|
||||||
: delay(1000 / framesPerSec), boardSize(boardX, boardY),
|
: delay(1000 / framesPerSec), boardSize(boardX, boardY),
|
||||||
snakeHead(boardX / 2, boardY / 2), GameBoard(boardX * boardY, 0),
|
snakeHead(boardX / 2, boardY / 2), GameBoard(boardX * boardY, 0),
|
||||||
snakeDir(0, -1) {
|
snakeDir(0, -1) {
|
||||||
@@ -190,7 +191,7 @@ std::unique_ptr<Game> game;
|
|||||||
void handleSignal(int signal) { game->end(); }
|
void handleSignal(int signal) { game->end(); }
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
game = std::make_unique<Game>(90, 30, 10);
|
game = std::make_unique<Game>();
|
||||||
std::signal(SIGTERM, handleSignal);
|
std::signal(SIGTERM, handleSignal);
|
||||||
std::signal(SIGINT, handleSignal);
|
std::signal(SIGINT, handleSignal);
|
||||||
game->start();
|
game->start();
|
||||||
|
|||||||
Reference in New Issue
Block a user