summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/castRay.cpp1
-rw-r--r--src/pixelfunc.cpp19
-rw-r--r--src/pixelfunc.h2
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);