Scorepoints
This commit is contained in:
parent
bd9abbe5bd
commit
ed0c9eb221
4 changed files with 26 additions and 0 deletions
2
makefile
2
makefile
|
|
@ -16,5 +16,7 @@ release: build/linux/raylib-test-linux-release
|
||||||
|
|
||||||
debug: build/linux/raylib-test-linux-debug
|
debug: build/linux/raylib-test-linux-debug
|
||||||
|
|
||||||
|
all: release debug
|
||||||
|
|
||||||
clean :
|
clean :
|
||||||
rm -r build/*
|
rm -r build/*
|
||||||
|
|
|
||||||
|
|
@ -47,4 +47,12 @@ class Wall : public Entity {
|
||||||
void draw() const override;
|
void draw() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Scorepoint : public Entity {
|
||||||
|
private:
|
||||||
|
TextureAtlas texture;
|
||||||
|
public:
|
||||||
|
Scorepoint();
|
||||||
|
void draw() const override;
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,11 @@ void load_world(World& world,const char* path) {
|
||||||
y++;
|
y++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
|
Scorepoint* point = new Scorepoint;
|
||||||
|
point->position = {(float)x*16,(float)y*16};
|
||||||
|
world.entities.push_back(point);
|
||||||
|
}
|
||||||
x++;
|
x++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11
src/scorepoint.cpp
Normal file
11
src/scorepoint.cpp
Normal 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);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue