diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2022-05-17 21:05:07 +0200 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2022-05-17 21:05:07 +0200 |
commit | f99fd52c5cfba6ce9fe959f057fdcc7266a1c33e (patch) | |
tree | 9dc9c4d4d25f5e147a3c695cb6dc768f9ea4a3ca | |
parent | initial commit (diff) | |
download | watchoom-f99fd52c5cfba6ce9fe959f057fdcc7266a1c33e.tar.gz watchoom-f99fd52c5cfba6ce9fe959f057fdcc7266a1c33e.tar.bz2 watchoom-f99fd52c5cfba6ce9fe959f057fdcc7266a1c33e.tar.xz watchoom-f99fd52c5cfba6ce9fe959f057fdcc7266a1c33e.tar.zst watchoom-f99fd52c5cfba6ce9fe959f057fdcc7266a1c33e.zip |
fuck
-rw-r--r-- | src/castRay.cpp | 1 | ||||
-rw-r--r-- | src/pixelfunc.cpp | 19 | ||||
-rw-r--r-- | src/pixelfunc.h | 2 |
3 files changed, 3 insertions, 19 deletions
diff --git a/src/castRay.cpp b/src/castRay.cpp index d8e7e20..866a2a0 100644 --- a/src/castRay.cpp +++ b/src/castRay.cpp @@ -4,6 +4,7 @@ void CastRay::drawLoop() { display.fillScreen(GxEPD_WHITE); + draw_doom(); } void CastRay::drawWatchFace() diff --git a/src/pixelfunc.cpp b/src/pixelfunc.cpp index 08bbee6..13da915 100644 --- a/src/pixelfunc.cpp +++ b/src/pixelfunc.cpp @@ -50,33 +50,16 @@ void draw_doom() camera.resolution.x = SCREEN_W; camera.resolution.y = SCREEN_H; - for (int i = 0; i < 10000; ++i) + for (int i = 0; i < 100; ++i) { draw(); - int squareX = RCL_divRoundDown(camera.position.x,RCL_UNITS_PER_SQUARE); - int squareY = RCL_divRoundDown(camera.position.y,RCL_UNITS_PER_SQUARE); - if (rand() % 100 == 0) { - dx = 1 - rand() % 3; - dy = 1 - rand() % 3; dr = 1 - rand() % 3; } - while (heightAt(squareX + dx,squareY + dy) > 0) - { - dx = 1 - rand() % 3; - dy = 1 - rand() % 3; - dr = 1 - rand() % 3; - } - - camera.position.x += dx * 200; - camera.position.y += dy * 200; - camera.direction += dr * 10; - camera.height = RCL_UNITS_PER_SQUARE + RCL_sin(frame * 16) / 2; - frame++; } } diff --git a/src/pixelfunc.h b/src/pixelfunc.h index 4316679..ed48aa0 100644 --- a/src/pixelfunc.h +++ b/src/pixelfunc.h @@ -41,7 +41,7 @@ const int8_t level[LEVEL_W * LEVEL_H] = // here 1 means wall, 0 floor 0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0 // 14 }; -void run_doom(); +void draw_doom(); void draw(); RCL_Unit heightAt(int16_t x, int16_t y); void pixelFunc(RCL_PixelInfo *p); |