-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
35 lines (26 loc) · 829 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React from 'react';
import { render } from 'react-dom';
import { buildContext,
restartGame,
getRandomInt,
expressionEvaluators,
actionHandlers,
nullValue,
getRandomlySelectedItemIndexByTags } from 'choba-engine';
import parser from './chobaParser';
import SceneView from './components/sceneView/SceneView';
import gameData from './game.choba';
let sceneDescriptions = parser.parse(gameData);
let context = buildContext({
initialVars: {},
scenes: sceneDescriptions
});
let { newScene, dynamicState } = restartGame(context);
function onOptionClicked(_index) {
console.log('Clicked on option ' + _index);
}
let container = document.getElementById('root');
render(
<SceneView scene={newScene} onOptionClicked={onOptionClicked}/>,
container
);