pitrix/include/effect_snake.h

27 lines
515 B
C
Raw Normal View History

2019-05-31 03:45:07 +00:00
#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);
2019-05-31 03:45:07 +00:00
public:
SnakeEffect();
2019-05-31 03:45:07 +00:00
void loop();
boolean valid_position(Coords c);
Coords update_position(Coords c, uint8_t direction);
boolean can_be_shown_with_clock();
};
#endif