Scorepoints

This commit is contained in:
rendo 2026-03-13 15:26:27 +05:00
commit ed0c9eb221
4 changed files with 26 additions and 0 deletions

View file

@ -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

View file

@ -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;
}

11
src/scorepoint.cpp Normal file
View file

@ -0,0 +1,11 @@
#include "components.h"
#include "world.h"
#include <raylib.h>
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);
}