Fix up few small things

This commit is contained in:
Dennis Schoepf 2021-08-06 14:00:18 +02:00
parent dc102a1590
commit 89d494fc3a
6 changed files with 506 additions and 62 deletions

View file

@ -94,13 +94,15 @@ export function generateRevealableCoords(): Coordinates[] {
const areaWidth = mp5.width / 3;
const rowHeight = mp5.height / 2;
// Max. 6 revealables one in each area
// Max. 8 revealables one in each area
return [
{ x: mp5.random(25, areaWidth), y: mp5.random(25, rowHeight) },
{ x: mp5.random(areaWidth, areaWidth * 2), y: mp5.random(25, rowHeight) },
{ x: mp5.random(areaWidth * 2, areaWidth * 3), y: mp5.random(25, rowHeight) },
{ x: mp5.random(areaWidth * 3, areaWidth * 4 - 25), y: mp5.random(25, rowHeight) },
{ x: mp5.random(25, areaWidth), y: mp5.random(rowHeight, rowHeight * 2) },
{ x: mp5.random(areaWidth, areaWidth * 2), y: mp5.random(rowHeight, rowHeight * 2) },
{ x: mp5.random(areaWidth * 2, areaWidth * 3), y: mp5.random(rowHeight, rowHeight * 2) },
{ x: mp5.random(areaWidth * 2, areaWidth * 4 - 25), y: mp5.random(rowHeight, rowHeight * 2) },
];
}

View file

@ -54,7 +54,7 @@ export class Logger {
if (uid) {
const logEvKey = this.database.ref(uid).child('logs').push().key;
this.database.ref(uid).update({ [`logs/${logEvKey}`]: ev });
// this.database.ref(uid).update({ [`logs/${logEvKey}`]: ev });
}
}

View file

@ -31,7 +31,7 @@ export class OverviewScene {
public onSceneClick() {
this.edges.forEach((edge, i) => {
const dist = mp5.dist(mp5.mouseX, mp5.mouseY, edge.x, edge.y);
if (dist < edge.r) {
if (dist < edge.currentSize) {
logger.log({
type: 'OC',
timestamp: Date.now(),

View file

@ -31,7 +31,7 @@ const store = create<State>(
devtools((set) => ({
uid: null,
showScore: false,
currentIntroStep: 1,
currentIntroStep: 0,
revealablesFinished: 0,
currentScene: Scenes.OVERVIEW,
currentSubproject: null,