Moved settings from preprocessor directives to variables. Also added a way to (for now only) display them via HTTP server.
This commit is contained in:
@ -11,8 +11,8 @@ SnakeEffect::~SnakeEffect() {
|
||||
}
|
||||
|
||||
void SnakeEffect::loop(uint16_t ms) {
|
||||
if (run++ % EFFECT_SNAKE_SLOWDOWN == 0) { // Change the coordinates only on every n-th run.
|
||||
if (random8(EFFECT_SNAKE_DIRECTION_CHANGE)==0 || is_turn_needed()) turn_random();
|
||||
if (run++ % settings.effects.snake.slowdown == 0) { // Change the coordinates only on every n-th run.
|
||||
if (random8(settings.effects.snake.direction_change)==0 || is_turn_needed()) turn_random();
|
||||
|
||||
this->coords = update_position(this->coords, this->direction);
|
||||
}
|
||||
|
Reference in New Issue
Block a user