Maploading

This commit is contained in:
rendo 2026-03-12 11:01:15 +05:00
commit a2dffd7cb9
8 changed files with 82 additions and 36 deletions

View file

@ -5,6 +5,7 @@ World::World(){
this->entities = {};
this->seconds_per_tick = 0;
this->clock = 0;
this->debug = false;
}
World::~World(){
@ -21,6 +22,11 @@ void World::setup(){
void World::process(){
this->clock += GetFrameTime();
if(IsKeyPressed(KEY_F2))
this->seconds_per_tick-=0.025;
if(IsKeyPressed(KEY_F3))
this->seconds_per_tick+=0.025;
this->update_grid();
for(int i = 0; i < this->entities.size(); i++) {
@ -39,6 +45,11 @@ void World::draw() const {
for(int i = 0; i < this->entities.size(); i++) {
this->entities[i]->draw();
}
if (this->debug == false)
return;
DrawText(TextFormat("entities: %i",this->entities.size()), 0, 0, 14, WHITE);
DrawText(TextFormat("seconds_per_tick: %f",this->seconds_per_tick), 0, 16, 14, WHITE);
}
int indexify_position(Vector2 vector){