33 lines
774 B
C
33 lines
774 B
C
/**
|
|
* Copyright (c) 2021 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#include "sandboxscene.h"
|
|
|
|
bool sandboxSceneInit(sandboxscene_t *game) {
|
|
// Init Scripter
|
|
scripterInit(&game->scripter, &game->engine);
|
|
game->scripter.user = game;
|
|
|
|
scriptsApiIo(&game->scripter);
|
|
scriptsApiDisplay(&game->scripter);
|
|
scriptsApiAsset(&game->scripter);
|
|
|
|
assetScripterAppend(&game->scripter, "scripts/main.js");
|
|
|
|
|
|
scripterInvokeMethodSimple(&game->scripter, "init");
|
|
|
|
return true;
|
|
}
|
|
|
|
void sandboxSceneUpdate(sandboxscene_t *game) {
|
|
scripterInvokeMethodSimple(&game->scripter, "update");
|
|
}
|
|
|
|
void sandboxSceneDispose(sandboxscene_t *game) {
|
|
scripterInvokeMethodSimple(&game->scripter, "dispose");
|
|
} |