-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple_ai.h
63 lines (32 loc) · 856 Bytes
/
simple_ai.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef SIMPLE_AI_H
#define SIMPLE_AI_H
#include "Arduino.h"
#include <Arduino_LED_Matrix.h>
class SimpleAI{
public:
SimpleAI(int speed = 10, int difficulty = 9);
void move();
void check_for_collisions();
void render_on_screen();
void reset_variables();
int get_score();
float _speed;
bool _playing;
private:
void generate_food();
void get_direction();
ArduinoLEDMatrix _matrix;
struct coordinates{
int x;
int y;
};
const int _screen_width = 12;
const int _screen_height = 8;
int _snake_length;
float _multiplier;
int _default_speed;
String _direction;
coordinates _snake[96];
coordinates _food;
};
#endif