diff --git a/makefile b/makefile index 37d8d4d..b095237 100644 --- a/makefile +++ b/makefile @@ -16,5 +16,7 @@ release: build/linux/raylib-test-linux-release debug: build/linux/raylib-test-linux-debug +all: release debug + clean : rm -r build/* diff --git a/src/components.h b/src/components.h index 574c2bd..d0c9d8c 100644 --- a/src/components.h +++ b/src/components.h @@ -47,4 +47,12 @@ class Wall : public Entity { void draw() const override; }; +class Scorepoint : public Entity { + private: + TextureAtlas texture; + public: + Scorepoint(); + void draw() const override; +}; + #endif diff --git a/src/maploader.cpp b/src/maploader.cpp index d24ed98..44533d3 100644 --- a/src/maploader.cpp +++ b/src/maploader.cpp @@ -39,6 +39,11 @@ void load_world(World& world,const char* path) { y++; break; default: + { + Scorepoint* point = new Scorepoint; + point->position = {(float)x*16,(float)y*16}; + world.entities.push_back(point); + } x++; break; } diff --git a/src/scorepoint.cpp b/src/scorepoint.cpp new file mode 100644 index 0000000..56dad22 --- /dev/null +++ b/src/scorepoint.cpp @@ -0,0 +1,11 @@ +#include "components.h" +#include "world.h" +#include + +Scorepoint::Scorepoint(){ + this->texture = TextureAtlas(get_world().get_atlas(),112,0,16,16); +} + +void Scorepoint::draw() const { + DrawTextureRec(this->texture.get_texture(), this->texture.full_view(), this->position, WHITE); +}