wip
This commit is contained in:
+5
-7
@@ -1,8 +1,8 @@
|
||||
#ifndef ENGINE_HPP
|
||||
#define ENGINE_HPP
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <array>
|
||||
|
||||
constexpr int ROW = 11;
|
||||
constexpr int COL = 11;
|
||||
@@ -21,7 +21,7 @@ struct vec2 {
|
||||
struct Window {
|
||||
std::array<std::array<char, COL>, ROW> view;
|
||||
void draw_display();
|
||||
void update_display(vec2 &head, vec2 &fruit, std::vector<vec2> &buf);
|
||||
void update_display(vec2 &head, vec2 &fruit, std::deque<vec2> &buf);
|
||||
};
|
||||
|
||||
class Engine {
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
|
||||
private:
|
||||
Window win;
|
||||
std::vector<vec2> tail;
|
||||
std::deque<vec2> tail;
|
||||
std::string status;
|
||||
vec2 head { COL / 2, ROW / 2 };
|
||||
vec2 fruit { rand() % COL, rand() % ROW };
|
||||
@@ -45,5 +45,3 @@ private:
|
||||
void add_tail_and_respawn_fruit();
|
||||
bool exit_summary();
|
||||
};
|
||||
|
||||
#endif // ELEMENT_HPP
|
||||
|
||||
Reference in New Issue
Block a user