mirror of
https://github.com/He4eT/DotDashPit.git
synced 2026-05-04 17:37:23 +00:00
game: gameover highscore sound
This commit is contained in:
parent
78a40cee31
commit
00bbe003ba
1 changed files with 11 additions and 9 deletions
20
game.js
20
game.js
|
|
@ -85,7 +85,7 @@ function drawMorse(codeList, x, y, color, width) {
|
||||||
function playMorseKey(seed) {
|
function playMorseKey(seed) {
|
||||||
const note = rnd(57, 72, seed)
|
const note = rnd(57, 72, seed)
|
||||||
const volume = rnd(8, 10, seed)
|
const volume = rnd(8, 10, seed)
|
||||||
sfx(4, note, 4, 0, volume, 0)
|
sfx(0, note, 4, 0, volume, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Arena */
|
/* Arena */
|
||||||
|
|
@ -632,20 +632,22 @@ function gameoverScreen() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function gameover() {
|
function gameover() {
|
||||||
sfx(0, 'F-2', 30, 1, 5)
|
currentScreen = 'gameoverScreen'
|
||||||
|
arena.gameoverTimestamp = time()
|
||||||
|
|
||||||
|
if (player.score > arena.highscore) {
|
||||||
|
pmem(0, player.score)
|
||||||
|
sfx(0, 'C-5', 30, 1, 6)
|
||||||
|
} else {
|
||||||
|
sfx(0, 'F-2', 30, 1, 5)
|
||||||
|
}
|
||||||
|
|
||||||
effects = [
|
effects = [
|
||||||
{
|
{
|
||||||
type: 'flash',
|
type: 'flash',
|
||||||
frames: '77777777777765432'.split(''),
|
frames: '77777777777765432'.split(''),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
if (player.score > arena.highscore) {
|
|
||||||
pmem(0, player.score)
|
|
||||||
}
|
|
||||||
|
|
||||||
arena.gameoverTimestamp = time()
|
|
||||||
currentScreen = 'gameoverScreen'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Utils */
|
/* Utils */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue