makefuture / games / accept-the-cookie / game / scenes / Zone5Scene.js
263 words
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { BaseZoneScene } from './BaseZoneScene.js?v=20260427c';
import { ZONE_DEFINITIONS } from '../systems/session.js?v=20260427c';

export class Zone5Scene extends BaseZoneScene {
    constructor() {
        super('Zone5Scene', ZONE_DEFINITIONS[4]);
    }

    drawBackground() {
        super.drawBackground();
        const clauses = [
            '14.3(b) You grant us a perpetual license to optimize your experience.',
            '7.2 Arbitration shall occur in a jurisdiction selected by the platform.',
            '3.1 Continued use constitutes informed, enthusiastic consent.',
            '9.8 Opt-out instructions may be modified without notice.',
        ];
        for (let y = 220; y < this.levelHeight; y += 120) {
            this.add.text(24, y, clauses[(y / 120) % clauses.length | 0], {
                fontFamily: 'Georgia, serif',
                fontSize: '18px',
                color: '#f4f4f4',
                alpha: 0.45,
                wordWrap: { width: Math.max(280, this.scale.width - 48) },
            });
        }
    }

    buildVerticalLevel() {
        super.buildVerticalLevel();
        const optOut = this.add.text(this.scale.width - 150, this.levelHeight * 0.42, 'opt out', {
            fontFamily: 'ui-monospace, monospace',
            fontSize: '10px',
            color: '#222222',
            backgroundColor: '#0a0a0a',
        });
        this.physics.add.existing(optOut, true);
        this.time.delayedCall(50, () => {
            if (!this.player) return;
            this.physics.add.overlap(this.player.sprite, optOut, () => {
                if (optOut.used) return;
                optOut.used = true;
                this.session.behavioral.optOutFound = true;
                optOut.setColor('#ffffff');
                this.algorithm.say('You found it. Legal has been notified.');
            });
        });
    }

    finishZone() {
        if (this.finished) return;
        this.session.flags.agreedTerms = true;
        this.cameras.main.flash(this.session.device.reducedMotion ? 0 : 120, 255, 255, 255);
        this.algorithm.say('Data breach is such an ugly phrase. We prefer value realization.');
        super.finishZone();
    }

    zonePrompts() {
        return [
            {
                at: 7,
                key: 'Agree to updated Terms',
                title: 'Agree to updated Terms?',
                copy: 'We improved the agreement. Accept for one extra life, or continue without agreeing via the small uncomfortable button.',
                accept: 'Agree',
                decline: 'Continue without agreeing',
                onAccept: () => {
                    this.session.flags.agreedTerms = true;
                    this.session.currencies.convenience += 1;
                },
                onDecline: () => {
                    this.session.behavioral.termsRead = true;
                },
            },
        ];
    }
}

static mirror of HEAD · about · clone: git clone https://git.makefuture.ro/makefuture.git