mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Scripting WIP (#70)
* Scripting introduced * AppImage workflow fixes * AppImage workflow simplified * README.md update * README.md update * small fix
This commit is contained in:
parent
ce26f0c227
commit
acce49f188
35 changed files with 649 additions and 138 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue