pitrix/include/effect_snake.h

26 lines
550 B
C
Raw Normal View History

#pragma once
2019-05-31 03:45:07 +00:00
#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-06-19 20:23:49 +00:00
~SnakeEffect();
void loop(uint16_t ms);
2019-05-31 03:45:07 +00:00
boolean valid_position(Coords c);
Coords update_position(Coords c, uint8_t direction);
boolean can_be_shown_with_clock();
String get_name() override { return "snake"; }
2019-05-31 03:45:07 +00:00
};