Statistik: pro Blockklasse zählen jetzt die zerstörten Blöcke (Summe = Total), zusätzliche Treffer-Zählung
This commit is contained in:
1 parent
cfd39ab565
commit
fcfe0653ad
1 file changed
+7
-4
+7
-4
@@ -297,8 +297,8 @@
|
||||
var combo = 0, comboT = 0, shake = 0, shakeX = 0, shakeY = 0, levelTimer = 0;
|
||||
var CHECKPOINT_EVERY = 5, MAX_CONTINUES = 3, CONTINUE_TIME = 10, START_LIVES = 3;
|
||||
var continues = MAX_CONTINUES, checkpoint = 1, continueT = 0, ccUsed = 0, contTick = 0;
|
||||
var stats = { blk: {}, down: 0, pu: {} };
|
||||
function resetStats() { stats = { blk: {}, down: 0, pu: {} }; }
|
||||
var stats = { blk: {}, down: 0, hits: 0, pu: {} };
|
||||
function resetStats() { stats = { blk: {}, down: 0, hits: 0, pu: {} }; }
|
||||
var sound = true, ac = null, fxSig = '';
|
||||
|
||||
var scores = [];
|
||||
@@ -318,7 +318,9 @@
|
||||
function statsHtml() {
|
||||
var hps = Object.keys(stats.blk).map(Number).sort(function (a, b) { return a - b; });
|
||||
var chips = hps.map(function (k) { return '<span class="stk">' + k + '×-Block <b>' + stats.blk[k] + '</b></span>'; });
|
||||
chips.push('<span class="stk tot">Blöcke zerstört <b>' + stats.down + '</b></span>');
|
||||
if (!chips.length) chips.push('<span class="stk">keine Blöcke zerstört</span>');
|
||||
chips.push('<span class="stk tot">zerstört <b>' + stats.down + '</b></span>');
|
||||
chips.push('<span class="stk tot">Treffer <b>' + stats.hits + '</b></span>');
|
||||
var pc = [];
|
||||
PU.forEach(function (p) {
|
||||
if (!stats.pu[p.id]) return;
|
||||
@@ -705,9 +707,10 @@
|
||||
/* ---------------- scoring ---------------- */
|
||||
function hitBrick(b) {
|
||||
b.hp--; b.flash = 1;
|
||||
stats.blk[b.max] = (stats.blk[b.max] || 0) + 1;
|
||||
stats.hits++;
|
||||
if (b.hp <= 0) {
|
||||
stats.down++;
|
||||
stats.blk[b.max] = (stats.blk[b.max] || 0) + 1;
|
||||
burst(b, b.c2); shake = Math.min(9, shake + 4);
|
||||
beep(210 + Math.min(combo, 12) * 42 + b.max * 18, 0.09, 'square', 0.05);
|
||||
dropPowerup(b.x + b.w / 2, b.y + b.h / 2);
|
||||
|
||||
Reference in new issue
Block a user