mirror of
https://github.com/solcloud/Counter-Strike.git
synced 2025-02-21 09:42:51 +01:00
Tuning
This commit is contained in:
parent
e7740f6772
commit
1190a74faf
@ -64,7 +64,7 @@ export class Radar {
|
|||||||
ctx.lineWidth = 10;
|
ctx.lineWidth = 10;
|
||||||
ctx.strokeStyle = "#70a670"
|
ctx.strokeStyle = "#70a670"
|
||||||
}
|
}
|
||||||
ctx.fillStyle = "#" + Color[player.getId()].toString(16).padStart(6, '0');
|
ctx.fillStyle = "#" + Color[player.data.color].toString(16).padStart(6, '0');
|
||||||
|
|
||||||
ctx.beginPath()
|
ctx.beginPath()
|
||||||
ctx.arc(player.data.position.x, -player.data.position.z, 50, 0, 2 * Math.PI)
|
ctx.arc(player.data.position.x, -player.data.position.z, 50, 0, 2 * Math.PI)
|
||||||
|
BIN
www/favicon.ico
BIN
www/favicon.ico
Binary file not shown.
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 4.4 KiB |
@ -41,6 +41,7 @@ foreach ($map->getBoxes() as $box) {
|
|||||||
<textarea class="extra">Generating...</textarea>
|
<textarea class="extra">Generating...</textarea>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
const forRadar = <?= ($radarMapGenerator ? 'true' : 'false') ?>;
|
||||||
let camera, scene, renderer, controls, extra;
|
let camera, scene, renderer, controls, extra;
|
||||||
const worldMaterial = new THREE.MeshLambertMaterial({color: 0x9f998e})
|
const worldMaterial = new THREE.MeshLambertMaterial({color: 0x9f998e})
|
||||||
const material = new THREE.MeshLambertMaterial({color: 0x664b17})
|
const material = new THREE.MeshLambertMaterial({color: 0x664b17})
|
||||||
@ -49,18 +50,18 @@ foreach ($map->getBoxes() as $box) {
|
|||||||
scene = new THREE.Scene();
|
scene = new THREE.Scene();
|
||||||
|
|
||||||
renderer = new THREE.WebGLRenderer({antialias: true});
|
renderer = new THREE.WebGLRenderer({antialias: true});
|
||||||
if (<?= (int)$radarMapGenerator ?>) {
|
if (forRadar) {
|
||||||
renderer.setSize(800, 800);
|
renderer.setSize(800, 800);
|
||||||
} else {
|
} else {
|
||||||
renderer.setSize(window.innerWidth, window.innerHeight);
|
renderer.setSize(window.innerWidth, window.innerHeight);
|
||||||
}
|
}
|
||||||
if (<?= (int)!$radarMapGenerator ?>) {
|
if (!forRadar) {
|
||||||
renderer.shadowMap.enabled = true;
|
renderer.shadowMap.enabled = true;
|
||||||
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
||||||
}
|
}
|
||||||
document.body.appendChild(renderer.domElement);
|
document.body.appendChild(renderer.domElement);
|
||||||
|
|
||||||
if (<?= (int)$radarMapGenerator ?>) {
|
if (forRadar) {
|
||||||
camera = new THREE.OrthographicCamera(-400, 400, 400, -400, 1, 9000)
|
camera = new THREE.OrthographicCamera(-400, 400, 400, -400, 1, 9000)
|
||||||
} else {
|
} else {
|
||||||
camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.01, 99999);
|
camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.01, 99999);
|
||||||
@ -109,7 +110,7 @@ foreach ($map->getBoxes() as $box) {
|
|||||||
center.position.set(box.width / 2, box.height / 2, box.depth / -2)
|
center.position.set(box.width / 2, box.height / 2, box.depth / -2)
|
||||||
center.visible = false
|
center.visible = false
|
||||||
map.add(center)
|
map.add(center)
|
||||||
if (<?= (int)!$radarMapGenerator ?>) {
|
if (!forRadar) {
|
||||||
camera.position.x = center.position.x;
|
camera.position.x = center.position.x;
|
||||||
camera.position.z = center.position.z;
|
camera.position.z = center.position.z;
|
||||||
camera.lookAt(camera.position.x, 0, camera.position.z)
|
camera.lookAt(camera.position.x, 0, camera.position.z)
|
||||||
@ -216,7 +217,7 @@ foreach ($map->getBoxes() as $box) {
|
|||||||
init()
|
init()
|
||||||
object()
|
object()
|
||||||
extraGeometry()
|
extraGeometry()
|
||||||
if (<?= (int)!$radarMapGenerator ?>) {
|
if (!forRadar) {
|
||||||
spawns()
|
spawns()
|
||||||
buyAreas()
|
buyAreas()
|
||||||
}
|
}
|
||||||
|
@ -1,74 +0,0 @@
|
|||||||
<!Doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Test</title>
|
|
||||||
<script src="./assets/threejs/three.js"></script>
|
|
||||||
<script src="./assets/js/utils.js"></script>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
let camera, scene, renderer;
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
scene = new THREE.Scene();
|
|
||||||
scene.background = new THREE.Color(0xdadada)
|
|
||||||
|
|
||||||
camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.01, 99);
|
|
||||||
camera.position.z = 9;
|
|
||||||
camera.position.y = 7;
|
|
||||||
camera.lookAt(0, 3, 0)
|
|
||||||
|
|
||||||
const gridHelper = new THREE.GridHelper(9, 9);
|
|
||||||
scene.add(gridHelper);
|
|
||||||
|
|
||||||
renderer = new THREE.WebGLRenderer({antialias: true});
|
|
||||||
renderer.setSize(window.innerWidth, window.innerHeight);
|
|
||||||
document.body.appendChild(renderer.domElement);
|
|
||||||
renderer.setAnimationLoop(animation);
|
|
||||||
}
|
|
||||||
|
|
||||||
let body, player
|
|
||||||
|
|
||||||
function object() {
|
|
||||||
const head = new THREE.Mesh(
|
|
||||||
new THREE.SphereGeometry(1),
|
|
||||||
new THREE.MeshBasicMaterial({
|
|
||||||
map: new THREE.TextureLoader().load(
|
|
||||||
'./resources/face.png'
|
|
||||||
)
|
|
||||||
})
|
|
||||||
);
|
|
||||||
head.name = "head"
|
|
||||||
head.position.y = 5 + 1
|
|
||||||
|
|
||||||
body = new THREE.Mesh(
|
|
||||||
new THREE.CylinderGeometry(1, 1, 5, 32),
|
|
||||||
new THREE.MeshBasicMaterial({color: 0x0000FF})
|
|
||||||
);
|
|
||||||
body.translateY(body.geometry.parameters.height / 2)
|
|
||||||
body.name = "body"
|
|
||||||
|
|
||||||
player = new THREE.Object3D();
|
|
||||||
head.rotation.reorder("YXZ")
|
|
||||||
head.rotateY(degreeToRadian(90))
|
|
||||||
player.add(head, body)
|
|
||||||
scene.add(player)
|
|
||||||
}
|
|
||||||
|
|
||||||
function animation(time) {
|
|
||||||
player.rotation.y -= 0.004
|
|
||||||
renderer.render(scene, camera);
|
|
||||||
}
|
|
||||||
|
|
||||||
init()
|
|
||||||
object()
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
x
Reference in New Issue
Block a user