Wiggle experiments

This commit is contained in:
2023-12-01 15:25:36 -05:00
parent cd9f90bcd4
commit 833bc560d0
5 changed files with 18 additions and 9 deletions

View File

@@ -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() {

View File

@@ -30,7 +30,7 @@ namespace object {
color_idx(0) {}
void setup();
void update();
bool update();
void render();
};
}

View File

@@ -15,6 +15,7 @@ using NewFontWriter = ::JabyEngine::FontWriter;
static object::Paco paco;
static FontPrimitive font_buffer[2][256];
static NewFontWriter new_font_writer;
static uint8_t wiggle_count = 0;
static void setup() {
static constexpr auto FontTIM = SimpleTIM(320, 0, 320, DefaultFont::Info.VRAMSize.height);
@@ -34,8 +35,10 @@ static void update() {
const auto end_pos = cursor.write(FontWriter::Position::create(0, 32), "Cody is cute\n&\na \x1b[8;0;0mBAAAAABY!!!");
cursor.write(end_pos, "\x1b[0;7;7mJaby was\nhere c:");
new_font_writer.write(Make::PositionI16(8, 8), "012345 ABCDEFGHIJKL\nabcedfghijkl");
paco.update();
new_font_writer.write(Make::PositionI16(8, 8), "012345 ABCDEFGHIJKL\nabcedfghijkl", GPU::Color24::Blue(), wiggle_count);
if(paco.update()) {
wiggle_count++;
}wiggle_count++;
}
static void render() {