mirror of
https://github.com/solcloud/Counter-Strike.git
synced 2025-02-19 15:45:10 +01:00
Fire sound
This commit is contained in:
parent
561118c8b3
commit
9ba2ef917b
@ -45,7 +45,7 @@ final class GrillEvent extends Event implements ForOneRoundMax
|
||||
private readonly int $flameRadius,
|
||||
private readonly int $flameHeight,
|
||||
private readonly Graph $graph,
|
||||
Point $start,
|
||||
private readonly Point $start,
|
||||
)
|
||||
{
|
||||
$flameArea = ($this->flameRadius * 2 + 1) ** 2;
|
||||
@ -163,4 +163,13 @@ final class GrillEvent extends Event implements ForOneRoundMax
|
||||
$this->playerTickHits[$playerId] = $tickId;
|
||||
}
|
||||
|
||||
public function serialize(): array
|
||||
{
|
||||
return [
|
||||
'position' => $this->start->toArray(),
|
||||
'maxTime' => $this->item->getMaxTimeMs(),
|
||||
'maxFlames' => $this->maxFlameCount,
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ export class EventProcessor {
|
||||
}
|
||||
|
||||
eventsCallback[EventList.GrillEvent] = function (data) {
|
||||
// todo play grill song
|
||||
game.grillStart(data.position, data.maxTime, data.maxFlames)
|
||||
}
|
||||
|
||||
this.#callbacks = eventsCallback
|
||||
|
@ -313,6 +313,10 @@ export class Game {
|
||||
delete this.#throwables[id]
|
||||
}
|
||||
|
||||
grillStart(position, maxTimeMs, maxFlamesCount) {
|
||||
this.#world.playSound('338301_4811732-lq.mp3', position, false)
|
||||
}
|
||||
|
||||
spawnFlame(point, size, height, fireId, flameId) {
|
||||
if (this.#flammable[fireId] === undefined) {
|
||||
this.#flammable[fireId] = {}
|
||||
|
@ -133,11 +133,8 @@ export class SoundRepository {
|
||||
return null
|
||||
}
|
||||
|
||||
if (type === SoundType.FLAME_SPAWN) {
|
||||
return null // todo
|
||||
}
|
||||
if (type === SoundType.FLAME_EXTINGUISH) {
|
||||
return null // todo
|
||||
if (type === SoundType.FLAME_SPAWN || type === SoundType.FLAME_EXTINGUISH) {
|
||||
return null
|
||||
}
|
||||
if (type === SoundType.GRENADE_AIR) {
|
||||
return '575509__awildfilli__granada_tiro.wav'
|
||||
|
@ -10,6 +10,7 @@ export class World {
|
||||
#modelRepository
|
||||
#decals = []
|
||||
#flames = []
|
||||
#flameGeometry = null
|
||||
volume = 30
|
||||
|
||||
constructor() {
|
||||
@ -174,9 +175,16 @@ export class World {
|
||||
}
|
||||
|
||||
spawnFlame(size, height) {
|
||||
if (this.#flameGeometry === null){
|
||||
this.#flameGeometry = []
|
||||
this.#flameGeometry.push(new THREE.ConeGeometry(size, height, 4))
|
||||
this.#flameGeometry.push(new THREE.ConeGeometry(size, height, 5))
|
||||
this.#flameGeometry.push(new THREE.ConeGeometry(size, height, 6))
|
||||
this.#flameGeometry.push(new THREE.ConeGeometry(size, height, 7))
|
||||
}
|
||||
let mesh = new THREE.Mesh(
|
||||
new THREE.ConeGeometry(size, height, randomInt(4, 7)),
|
||||
new THREE.MeshStandardMaterial({color: new THREE.Color(`hsl(53, 100%, ${Math.random() * 70 + 20}%, 1)`)}),
|
||||
this.#flameGeometry[randomInt(0, this.#flameGeometry.length - 1)],
|
||||
new THREE.MeshBasicMaterial({color: new THREE.Color(`hsl(53, 100%, ${Math.random() * 70 + 20}%, 1)`)}),
|
||||
)
|
||||
|
||||
mesh.castShadow = false
|
||||
|
BIN
www/resources/sound/338301_4811732-lq.mp3
Normal file
BIN
www/resources/sound/338301_4811732-lq.mp3
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user