diff --git a/Block.cpp b/Block.cpp new file mode 100644 index 0000000..5f224f0 --- /dev/null +++ b/Block.cpp @@ -0,0 +1,8 @@ +#include "Block.h" + +Block::Block(int x, int y, int R, int B, int G) +{ + X = x; + Y = y; + color = std::make_tuple(R, G, B); +} \ No newline at end of file diff --git a/Block.h b/Block.h new file mode 100644 index 0000000..2f4a7fd --- /dev/null +++ b/Block.h @@ -0,0 +1,14 @@ +#pragma once +#include + +class Block +{ +public: + Block(){}; + Block(int x, int y, int R, int B, int G); + void display(float CameraX, float CameraY, float Zoom); +private: + int X; + int Y; + std::tuple color; +}; \ No newline at end of file diff --git a/C++ProjectTemplate b/C++ProjectTemplate index 1d27da5..5e869d1 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/main.cpp b/main.cpp index 4619b44..622b2d5 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,7 @@ #define OLC_PGE_APPLICATION #include "pixelGameEngine.h" +#include +#include "Block.h" class Example : public olc::PixelGameEngine { @@ -10,20 +12,17 @@ public: } public: + std::unordered_map Blocks; bool OnUserCreate() override { // Called once at the start, so create things here + Blocks[126]=Block(25,10,255,255,255); return true; } bool OnUserUpdate(float fElapsedTime) override { - ConsoleShow(olc::ESCAPE,false); - // called once per frame - for (int x = 0; x < ScreenWidth(); x++) - for (int y = 0; y < ScreenHeight(); y++) - Draw(x, y, olc::Pixel(rand() % 255, rand() % 255, rand()% 255)); - return true; + return true; } };