-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
53 lines (41 loc) · 1.32 KB
/
main.js
File metadata and controls
53 lines (41 loc) · 1.32 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { Scene } from './src/Scene';
import { Snowman } from './src/Snowman';
import { Fireplace } from './src/Fireplace';
import { Snow } from './src/Snow';
import { AudioManager } from './src/AudioManager';
import { InteractionManager } from './src/InteractionManager';
import { SantaSleigh } from './src/SantaSleigh';
// Scene oluştur
const scene = new Scene().initialize();
// Audio manager oluştur
const audioManager = new AudioManager();
// Interaction manager oluştur
const interactionManager = new InteractionManager(scene.getCamera(), audioManager);
// Zemin ve ışıkları oluştur
scene.createGround();
scene.setupLights();
// Kardan adam oluştur
const snowman = new Snowman();
scene.add(snowman.create());
interactionManager.setNose(snowman.getNose());
interactionManager.setSnowman(snowman);
// Noel Baba ve kızağını oluştur
const santaSleigh = new SantaSleigh();
scene.add(santaSleigh.create());
// Ocak oluştur
const fireplace = new Fireplace();
scene.add(fireplace.create());
interactionManager.setFireplace(fireplace);
// Kar oluştur
const snow = new Snow();
scene.add(snow.create());
// Animasyon döngüsü
function animate() {
requestAnimationFrame(animate);
scene.update();
snow.animate();
fireplace.animateFire();
interactionManager.update();
scene.render();
}
animate();