Facts you learn as you play (SkyCash): tips priced from the live IAP catalog on the lobby, run-over and chapter-cleared cards; Level up on InstantAdPay button in the lobby
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
+6
-5
@@ -6,7 +6,8 @@ var $ = function (id) { return document.getElementById(id); };
|
||||
var canvas = $('game'), ctx = canvas.getContext('2d');
|
||||
var W = 390, H = 760, DPR = 1, floorY = H - DRSpawn.FLOOR;
|
||||
var player = { x: 100, y: 300, vy: 0, r: 13, tilt: 0 };
|
||||
var ME = null, P = null, BAL = null, POOL = null, IAP = 'https://instantadpay.com';
|
||||
var ME = null, P = null, BAL = null, POOL = null, IAP = 'https://instantadpay.com', TIPS = [], tipAt = Math.floor(Math.random() * 97);
|
||||
function tip(id) { var el = $(id); if (!TIPS.length) { el.hidden = true; return; } var t = TIPS[tipAt++ % TIPS.length]; el.innerHTML = '<b>Did you know</b>' + esc(t); el.hidden = false; } // rotates through the facts
|
||||
var R = null; // the live run
|
||||
var muted = false; try { muted = localStorage.getItem('dr.muted') === '1'; } catch (e) {}
|
||||
|
||||
@@ -43,12 +44,12 @@ var hudCache = {}; function setHud() { if (!R) return; var v = { d: R.drips, c:
|
||||
function f3(n) { return Number(n || 0).toFixed(3); }
|
||||
|
||||
/* ---------- lobby / me ---------- */
|
||||
function loadMe() { return api('/api/me').then(function (r) { if (r._status !== 200) throw r; ME = r.me; P = r.player; BAL = r.balance; POOL = r.pool; IAP = r.iap || IAP; return r; }); }
|
||||
function loadMe() { return api('/api/me').then(function (r) { if (r._status !== 200) throw r; ME = r.me; P = r.player; BAL = r.balance; POOL = r.pool; IAP = r.iap || IAP; TIPS = r.tips || []; return r; }); }
|
||||
function lobby() {
|
||||
R = null; $('hud').classList.remove('on'); $('tapdesk').hidden = true;
|
||||
$('lChap').textContent = P.chapter; $('lDrips').textContent = P.bank.toLocaleString(); $('lPol').textContent = f3(BAL.unpaid);
|
||||
$('lPool').innerHTML = 'POL pool <b>' + f3(POOL.available) + '</b> · today’s cap left <b>' + f3(POOL.capLeft) + '</b> · a chapter drip is <b>' + f3(POOL.dripPol) + '</b>';
|
||||
$('lIap').href = IAP + '/my';
|
||||
$('lIap').href = IAP + '/my'; $('bLevel').href = IAP + '/my#buy'; tip('lTip');
|
||||
$('lMember').innerHTML = '<i class="' + (ME.wallet ? '' : 'no') + '"></i>InstantAdPay · ' + (ME.username ? '@' + ME.username : '#' + ME.memberId) + ' · ' + (ME.wallet ? ME.wallet.slice(0, 6) + '…' + ME.wallet.slice(-4) : 'no wallet on file');
|
||||
show('ovLobby');
|
||||
}
|
||||
@@ -110,7 +111,7 @@ function update(dt) {
|
||||
function crash(x, y) { sfx.crash(); burst(x, y, 36, '255,59,122', 260); burst(x, y, 14, '255,255,255', 160); R.shake = .5; over('Courier hit', 'A bot got you.'); }
|
||||
function over(title, why) {
|
||||
R.paused = true; flush(false);
|
||||
setTimeout(function () { if (!R) return; $('oEyebrow').textContent = title; $('oTitle').textContent = 'Run over at ' + R.drips; $('oText').textContent = why + ' Refuel with a sponsor visit and keep this run, drips and chapter progress intact.'; $('bRefuel').hidden = false; $('oChip').hidden = false; show('ovOver'); }, 450);
|
||||
setTimeout(function () { if (!R) return; $('oEyebrow').textContent = title; $('oTitle').textContent = 'Run over at ' + R.drips; $('oText').textContent = why + ' Refuel with a sponsor visit and keep this run, drips and chapter progress intact.'; $('bRefuel').hidden = false; $('oChip').hidden = false; tip('oTip'); show('ovOver'); }, 450);
|
||||
}
|
||||
function cleared() {
|
||||
R.paused = true; pill('Verifying…');
|
||||
@@ -124,7 +125,7 @@ function cleared() {
|
||||
var why = { paid: 'First clear, verified. Added to your game balance.', replay: c.first ? 'Verified.' : 'You cleared this one before. Only the first clear pays.', pool: 'The POL pool is empty right now. Refuel visits fill it, so this clear counts but pays nothing.', cap: 'Today’s pool cap is spent. Chapter counts, no POL today.', flagged: 'This run was flagged by the server check, so it pays nothing.' };
|
||||
$('cText').textContent = why[c.reason] || ''; $('cChip').className = 'chip ' + (c.pol ? 'ok' : 'sig'); $('cChip').textContent = (c.pol ? 'verified' : c.reason) + ' · ' + tm + ' play time';
|
||||
R.chapter = c.next; R.goal = c.nextGoal; R.chapDrips = 0; if (r.pool != null) POOL.available = r.pool;
|
||||
setTimeout(function () { show('ovClear'); }, 500);
|
||||
tip('cTip'); setTimeout(function () { show('ovClear'); }, 500);
|
||||
});
|
||||
}
|
||||
$('bNext').addEventListener('click', function () { if (!R) return; R.paused = false; R.inv = 1.5; hideAll(); });
|
||||
|
||||
Reference in New Issue
Block a user