-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
24 lines (19 loc) · 766 Bytes
/
script.js
File metadata and controls
24 lines (19 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import * as THREE from 'https://cdn.skypack.dev/three@0.129.0/build/three.module.js';
import { createMenu } from './game/menu.js';
import { createLevel1 } from './game/level1.js';
import { createLevel2 } from './game/level2.js';
console.log(THREE);
// Basic Setup
const renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
// Start the Game
function startGame() {
createLevel1(renderer, scene, camera, () => {
alert("You completed Level 2! Add a transition to Level 2 here.");
});
}
// Show the Menu
createMenu(startGame);