28 lines
532 B
C++
28 lines
532 B
C++
#ifndef effect_snake_H
|
|
#define effect_snake_H
|
|
|
|
#include "Effect.h"
|
|
#include "prototypes.h"
|
|
|
|
class SnakeEffect : public Effect {
|
|
private:
|
|
Coords coords;
|
|
uint8_t direction = 1;
|
|
uint8_t hue = 0;
|
|
uint8_t run = 0;
|
|
bool is_turn_needed();
|
|
void turn_random();
|
|
bool turn_right();
|
|
bool turn_left();
|
|
bool is_direction_okay(uint8_t direction);
|
|
public:
|
|
SnakeEffect();
|
|
~SnakeEffect();
|
|
void loop();
|
|
boolean valid_position(Coords c);
|
|
Coords update_position(Coords c, uint8_t direction);
|
|
boolean can_be_shown_with_clock();
|
|
};
|
|
|
|
#endif
|