diff --git a/src/game/sandbox/sandboxscene.c b/src/game/sandbox/sandboxscene.c index 2eff1d97..9c05b34f 100644 --- a/src/game/sandbox/sandboxscene.c +++ b/src/game/sandbox/sandboxscene.c @@ -28,9 +28,9 @@ bool sandboxSceneInit(sandboxscene_t *game) { } void sandboxSceneUpdate(sandboxscene_t *game) { - // scripterInvokeMethodSimple(&game->scripter, "update"); + scripterInvokeMethodSimple(&game->scripter, "update"); } void sandboxSceneDispose(sandboxscene_t *game) { - // scripterInvokeMethodSimple(&game->scripter, "dispose"); + scripterInvokeMethodSimple(&game->scripter, "dispose"); } \ No newline at end of file diff --git a/src/game/sandbox/sandboxscene.h b/src/game/sandbox/sandboxscene.h index f7cbe88c..8f8878cd 100644 --- a/src/game/sandbox/sandboxscene.h +++ b/src/game/sandbox/sandboxscene.h @@ -29,6 +29,7 @@ #include "../../script/api/io.h" #include "../../script/api/display.h" #include "../../script/api/asset.h" +#include "../../script/api/epoch.h" typedef struct { engine_t engine; diff --git a/ts/game/Game.ts b/ts/game/Game.ts index eb78c71a..229deb74 100644 --- a/ts/game/Game.ts +++ b/ts/game/Game.ts @@ -8,7 +8,7 @@ type Time = { export class Game { public time:Time; - private scene:Scene|null; + public scene:Scene|null; constructor() { this.time = { delta: 0, current: 0, last: 0 }; @@ -53,9 +53,8 @@ export const gameSetMain = (game:Game) => { * Method that is invoked by C when the game needs to intialize. */ const init = () => { - print("init"); - // if(!GAME_MAIN) return; - // GAME_MAIN.init(); + if(!GAME_MAIN) return; + GAME_MAIN.init(); } /** diff --git a/ts/main.ts b/ts/main.ts index ff5fa7b6..672b81d2 100644 --- a/ts/main.ts +++ b/ts/main.ts @@ -32,6 +32,7 @@ class TestScene extends Scene { shaderUse(this.shader); shaderUseCamera(this.shader, this.camera); shaderUsePosition(this.shader, 0,0,0, 0,this.game.time.current,0); + shaderUseTexture(this.shader, this.texture); primitiveDraw(this.quad, 0, -1); } @@ -43,6 +44,7 @@ class MainGame extends Game { constructor() { super(); this.setScene(new TestScene(this)); + this.scene.init(); } }