final commit

This commit is contained in:
glazenbol
2026-06-28 12:44:07 +02:00
parent ff58292273
commit 7b61244940
3 changed files with 23 additions and 12 deletions
+5 -3
View File
@@ -7,15 +7,17 @@ const gui = new GUI();
const params = {
fps: 60,
zoom: 1,
backgroundTicks: 60,
backgroundTicks: 900,
textSpread: 0,
maxSpawns: 1,
textAlpha: 0.0,
textTicks: 1,
disableScreen: false,
};
gui.add(params, "fps", 0.1, 60);
gui.add(params, "zoom", 1, 20);
gui.add(params, "backgroundTicks", 1, 600).step(1);
gui.add(params, "zoom", 1, 5);
gui.add(params, "backgroundTicks", 1, 900).step(1);
gui.add(params, "disableScreen", false);
const textFolder = gui.addFolder("Text");
textFolder.add(params, "textSpread", 0, 200);
textFolder.add(params, "maxSpawns", 1, 20).step(1);
+7 -1
View File
@@ -6,6 +6,7 @@ const params = {
fps: 60,
zoom: 1, //in pixels per pixel
backgroundTicks: 60,
disableScreen: false,
textSpread: 0,
maxSpawns: 1,
textAlpha: 0.0,
@@ -17,6 +18,11 @@ socket.on("paramUpdate", ({ key, value }) => {
console.log(`Updated param ${key} to ${value}`);
});
let bgTick = 0;
socket.on("pulse", () => {
bgTick = 0;
});
const poem =
"everybody is pretty ugly \
lover \
@@ -119,7 +125,6 @@ const sketch = (p) => {
// const stream = c.elt.captureStream(60);
};
let bgTick = 0;
let textTick = 0;
let sx, sy;
let cw, ch;
@@ -186,6 +191,7 @@ const sketch = (p) => {
function drawTiles(x, y, width, height) {
// clear screen
p.background(p.color(1, 0, 0, 0));
if (params.disableScreen) return;
p.shader(shaderProgram);
// p.ortho(0, p.width, -p.height, 0);
+11 -8
View File
@@ -1,15 +1,14 @@
import express from 'express';
import http from 'http';
import { Server } from 'socket.io';
import express from "express";
import http from "http";
import { Server } from "socket.io";
const app = express();
const server = http.createServer(app);
const io = new Server(server, {
cors: {
origin: "http://localhost:5173", // allow Vite frontend
methods: ["GET", "POST"]
}
methods: ["GET", "POST"],
},
});
// Socket.IO events
@@ -20,10 +19,14 @@ io.on("connection", (socket) => {
socket.broadcast.emit("paramUpdate", data);
});
socket.on("pulse", () => {
socket.broadcast.emit("pulse");
});
socket.on("disconnect", () => {
console.log("Client disconnected:", socket.id);
});
});
app.use(express.static('frontend/dist'));
server.listen(3000, () => console.log('Server running on http://localhost'));
app.use(express.static("frontend/dist"));
server.listen(3000, () => console.log("Server running on http://localhost"));