Just wrote my own entity system to figure it out.
This commit is contained in:
parent
a3eaf78fd3
commit
cc4f83a1d1
8 changed files with 229 additions and 59 deletions
8
gui.cpp
8
gui.cpp
|
@ -168,8 +168,8 @@ void GUI::handle_events() {
|
|||
void GUI::burn() {
|
||||
for(int i = 0; i < 20; ++i) {
|
||||
$map_text.setFillColor(color(i % VALUES.size()));
|
||||
int x = Random::rand_int(-10,10);
|
||||
int y = Random::rand_int(-10,10);
|
||||
int x = Random::uniform<int>(-10,10);
|
||||
int y = Random::uniform<int>(-10,10);
|
||||
draw_screen(false, x, y);
|
||||
std::this_thread::sleep_for(2ms);
|
||||
}
|
||||
|
@ -187,8 +187,8 @@ void GUI::draw_screen(bool clear, float map_off_x, float map_off_y) {
|
|||
|
||||
void GUI::shake() {
|
||||
for(int i = 0; i < 10; ++i) {
|
||||
int x = Random::rand_int(-10,10);
|
||||
int y = Random::rand_int(-10,10);
|
||||
int x = Random::uniform<int>(-10,10);
|
||||
int y = Random::uniform<int>(-10,10);
|
||||
// add x/y back to draw screen
|
||||
draw_screen(true, x, y);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue