MCPcopy
hub / github.com/arcxingye/EatKano / showGameScoreLayer

Function showGameScoreLayer

static/index.js:438–454  ·  view source on GitHub ↗
(cps)

Source from the content-addressed store, hash-verified

436 }
437
438 function showGameScoreLayer(cps) {
439 let l = $('#GameScoreLayer');
440 let c = $(`#${_gameBBList[_gameBBListIndex - 1].id}`).attr('class').match(_ttreg)[1];
441 let score = (mode === MODE_ENDLESS ? cps : _gameScore);
442 let best = getBestScore(score);
443 l.attr('class', l.attr('class').replace(/bgc\d/, 'bgc' + c));
444 $('#GameScoreLayer-text').html(shareText(cps));
445 let normalCond = legalDeviationTime() || mode !== MODE_NORMAL;
446 l.css('color', normalCond ? '': 'red');
447
448 $('#cps').text(cps.toFixed(2));
449 $('#score').text(scoreToString(score));
450 $('#GameScoreLayer-score').css('display', mode === MODE_ENDLESS ? 'none' : '');
451 $('#best').text(scoreToString(best));
452
453 l.css('display', 'block');
454 }
455
456 function hideGameScoreLayer() {
457 $('#GameScoreLayer').css('display', 'none');

Callers 1

gameOverFunction · 0.85

Calls 4

getBestScoreFunction · 0.85
shareTextFunction · 0.85
legalDeviationTimeFunction · 0.85
scoreToStringFunction · 0.85

Tested by

no test coverage detected