Wiggle experiments
This commit is contained in:
@@ -9,13 +9,16 @@ namespace object {
|
||||
this->tex_page.concat(this->sprite);
|
||||
}
|
||||
|
||||
void Paco :: update() {
|
||||
bool Paco :: update() {
|
||||
if(this->timer.is_expired_for(325_ms)) {
|
||||
static constexpr uint8_t LastIDX = (sizeof(Paco::Colors)/sizeof(Paco::Colors[0])) - 1;
|
||||
|
||||
this->color_idx = (this->color_idx == LastIDX) ? 0 : this->color_idx + 1;
|
||||
this->timer.reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Paco :: render() {
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace object {
|
||||
color_idx(0) {}
|
||||
|
||||
void setup();
|
||||
void update();
|
||||
bool update();
|
||||
void render();
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user