summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/_env.js
blob: 3cfe969ec9954ad4051000589d86aa737dc5dd40 (plain)
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
var environment = new function(){}
environment.init = function(){

	map = new Map ()

	if (window.scene) {
		scene.camera.move({
			"x": 0,
			"y": 0,
			"z": 0,
			"rotationX": 0, // PI/2,
			"rotationY": PI/2, // PI
// 			"rotationX": 0,
// 			"rotationY": PI
		})
		
		scene.camera.radius = 20
	}
	
	app.movements.gravity(true)
	
	Rooms.init()
	Scenery.init()
	
	scene.update()
	environment.update()
	
	var minimap_el = document.querySelector("#minimap .el")
	if (minimap_el) {
		window.minimap = new Map ({
			type: "minimap",
			el: document.querySelector("#minimap .el"),
			width: 130,
			height: 130,
			zoom: -4.8	
		})
	}
}
environment.update = function(t){
	map.update()
	window.minimap && window.minimap.update && minimap.update()
	z = false
}