// Entry point, run once by the engine after every other system is ready. var camera = entityAdd(); var cameraPosition = entityAddComponent(camera, COMPONENT_TYPE_POSITION); entityAddComponent(camera, COMPONENT_TYPE_CAMERA); entityPositionLookAt(camera, cameraPosition, 3, 3, 3, 0, 0, 0); var cube = entityAdd(); var cubePosition = entityAddComponent(cube, COMPONENT_TYPE_POSITION); var cubeRenderable = entityAddComponent(cube, COMPONENT_TYPE_RENDERABLE); entityRenderableSetMesh(cube, cubeRenderable, "cube"); entityPositionSetLocalPosition(cube, cubePosition, 0, 0, 0); var plane = entityAdd(); var planePosition = entityAddComponent(plane, COMPONENT_TYPE_POSITION); var planeRenderable = entityAddComponent(plane, COMPONENT_TYPE_RENDERABLE); entityRenderableSetMesh(plane, planeRenderable, "plane"); entityPositionSetLocalPosition(plane, planePosition, 0, 0, 0); consolePrint("Camera, cube and plane created");