Scripting WIP (#70)

* Scripting introduced

* AppImage workflow fixes

* AppImage workflow simplified

* README.md update

* README.md update

* small fix
This commit is contained in:
MihailRis
2023-12-25 05:26:03 +03:00
committed by GitHub
parent ce26f0c227
commit acce49f188
35 changed files with 649 additions and 138 deletions
+12 -11
View File
@@ -2,28 +2,29 @@
#include "../world/Level.h"
#include "PlayerController.h"
#include "BlocksController.h"
#include "ChunksController.h"
#include "scripting/scripting.h"
LevelController::LevelController(EngineSettings& settings, Level* level)
: settings(settings), level(level) {
chunks = new ChunksController(
level,
level->chunks,
level->lighting,
settings.chunks.padding);
player = new PlayerController(level, settings);
blocks = new BlocksController(level, settings.chunks.padding);
chunks = new ChunksController(level, settings.chunks.padding);
player = new PlayerController(level, settings, blocks);
scripting::on_world_load(level);
}
LevelController::~LevelController() {
scripting::on_world_quit();
delete player;
delete chunks;
}
void LevelController::update(
float delta,
bool input,
bool pause) {
void LevelController::update(float delta, bool input, bool pause) {
player->update(delta, input, pause);
level->update();
chunks->update(settings.chunks.loadSpeed);
}
blocks->update(delta);
}