Skip to content

Commit

Permalink
Update starfield.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Rukario authored Sep 22, 2024
1 parent 4dda1f1 commit 10c53e5
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions Uninteresting stuff/starfield.html
Original file line number Diff line number Diff line change
Expand Up @@ -2037,17 +2037,23 @@
context.fillStyle = qixdb.color;
context.fillRect(0, 0, canvas.width, canvas.height);

context.drawImage(spoiler.canvas, dim.x - qixscr.x * qixsc, dim.y - qixscr.y * qixsc, spoiler.width, spoiler.height);
const worldmap = {
x: dim.x - qixscr.x * qixsc*qixzoom,
y: dim.y - qixscr.y * qixsc*qixzoom,
width: spoiler.width*qixzoom,
height: spoiler.height*qixzoom,
}
context.drawImage(spoiler.canvas, worldmap.x, worldmap.y, worldmap.width, worldmap.height);

spoilermask.clearRect(0, 0, spoilermask.width, spoilermask.height);
spoilermask.drawImage(qixmask.canvas, 0, 0, qixmask.width*qixsc, qixmask.height*qixsc);
spoilermask.globalCompositeOperation = 'source-in';
spoilermask.drawImage(silhouette, 0, 0, spoilermask.width, spoilermask.height);
spoilermask.globalCompositeOperation = 'source-over';

context.drawImage(spoilermask.canvas, dim.x - qixscr.x * qixsc, dim.y - qixscr.y * qixsc, spoilermask.width, spoilermask.height);
context.drawImage(spoilermask.canvas, worldmap.x, worldmap.y, worldmap.width, worldmap.height);

context.drawImage(cards['freemon'], 38*face, 38*anger, 38, 38, dim.x-19 + (qixpos.x-qixscr.x)*qixsc, dim.y-19 + (qixpos.y-qixscr.y)*qixsc, 38, 38);
context.drawImage(cards['freemon'], 38*face, 38*anger, 38, 38, dim.x-19*qixzoom + (qixpos.x-qixscr.x)*qixsc, dim.y-19*qixzoom + (qixpos.y-qixscr.y)*qixsc, 38*qixzoom, 38*qixzoom);
},
}

Expand Down Expand Up @@ -3633,6 +3639,7 @@


let mobspawner;
let qixzoom = 1;
function new_qix() {
qixdim = {
x: Math.floor(qixmask.width / 2),
Expand Down Expand Up @@ -3733,6 +3740,7 @@
}
}, 2500);

qixzoom = 1;
qixmap = qixmask.getImageData(0, 0, qixmask.width, qixmask.height);
for (const n of Array(qixmap.data.length/4).keys()) {
qixmap.data[n*4] = 0;
Expand Down Expand Up @@ -4382,6 +4390,15 @@
qixstep();
}

if (Keypress.KeyE || Keypress.KeyC || Keypress.KeyZ) {
if (Keypress.KeyZ) {
qixzoom = 1;
} else {
qixzoom = Keypress.KeyE ? qixzoom*1.01 : qixzoom/1.01;
}
repaint.qix();
}

for (const sate of qixsates) {
if ('TFGH'.split('').some((k) => Keypress['Key' + k])) {
sate.dir.n = Keypress.KeyT;
Expand Down

0 comments on commit 10c53e5

Please # to comment.