Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungThe Model Got Better. Your Judgment Got Worse.(22.09.2026 um 03:02 Uhr)
Sichere ProgrammierungAIFeed - signed content permissions for AI web crawlers(22.09.2026 um 03:10 Uhr)
Sichere ProgrammierungThanks, glad you liked it!(22.09.2026 um 03:15 Uhr)
Sichere ProgrammierungA request for /.env shouldn't render your React app(22.09.2026 um 03:17 Uhr)
Sichere ProgrammierungAI-Agent Marketplaces Need Verifiable Delivery, Not More Listings(22.09.2026 um 03:20 Uhr)
AI & KI NachrichtenBeyond Bigger Models: Toward a Modular Cognitive Architecture(22.09.2026 um 03:21 Uhr)
Sichere ProgrammierungMasa Depan Manajemen Data: Mengenal Konsep Data Mesh yang Revolusioner(22.09.2026 um 03:22 Uhr)
Sichere ProgrammierungHow to Search Your Claude Code Conversation History(22.09.2026 um 03:22 Uhr)
Sichere ProgrammierungThe Model Got Better. Your Judgment Got Worse.(22.09.2026 um 03:02 Uhr)
Sichere ProgrammierungAIFeed - signed content permissions for AI web crawlers(22.09.2026 um 03:10 Uhr)
Sichere ProgrammierungThanks, glad you liked it!(22.09.2026 um 03:15 Uhr)
Sichere ProgrammierungA request for /.env shouldn't render your React app(22.09.2026 um 03:17 Uhr)
Sichere ProgrammierungAI-Agent Marketplaces Need Verifiable Delivery, Not More Listings(22.09.2026 um 03:20 Uhr)
AI & KI NachrichtenBeyond Bigger Models: Toward a Modular Cognitive Architecture(22.09.2026 um 03:21 Uhr)
Sichere ProgrammierungMasa Depan Manajemen Data: Mengenal Konsep Data Mesh yang Revolusioner(22.09.2026 um 03:22 Uhr)
Sichere ProgrammierungHow to Search Your Claude Code Conversation History(22.09.2026 um 03:22 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Building the Bubble Estimator Game: A JavaScript Project with SVG and Sound Effects

Last week a colleague asked me to estimate the number of people at an event and that was when it became apparent to both of us that my estimation skills are terrible. I was so embarrassed! That night, I decided to try and code a game that…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Last week a colleague asked me to estimate the number of people at an event and that was when it became apparent to both of us that my estimation skills are terrible. I was so embarrassed! That night, I decided to try and code a game that would help me get better at estimating.



Technologies Used

The Bubble Estimator Game utilizes the following technologies:



JavaScript: The backbone of the game logic, handling bubble creation, user input, and scoring.

SVG (Scalable Vector Graphics): Providing visually appealing and scalable graphics for the dynamic bubbles.

Web Audio API: Adding sound effects to enhance the gaming experience.

Features

Dynamic creation of bubbles with varying sizes, colors, and positions.

Sound effects using the Web Audio API to create a lively atmosphere.

User input for estimating the number of bubbles created.

Scoring system based on the accuracy of the user's estimate.



Code Highlights

I am so proud of the bubble generator function, which is a simple recursive function responsible for all the magic!




function createBubbles(svg, centerX, centerY, radius, depth) {
if (depth === 0) {
return;
}

const numBubbles = Math.floor(Math.random() * 6) + 2;

const angleIncrement = (3 * Math.PI) / numBubbles;
for (let i = 0; i < numBubbles; i++) {
const angle = i * angleIncrement;
//cartesian coordinates
const x = radius * Math.cos(angle) + centerX;
const y = radius * Math.sin(angle) + centerY;
const newRadius = radius / (Math.random() + 1);
const newX = x + newRadius * Math.cos(angle);
const newY = y + newRadius * Math.sin(angle);

//draw circle
const circle = document.createElementNS(
"http://www.w3.org/2000/svg",
"circle"
);
circle.setAttribute("cx", newX);
circle.setAttribute("cy", newY);
circle.setAttribute("r", newRadius);

//color
const randomColor = generateRandomColor();
circle.setAttribute("fill", randomColor);

circlesDrawn++;
console.log("num bubbles", circlesDrawn);
svg.appendChild(circle);
//play sound
playBlopSound();

//recursive case
setTimeout(() => {
circle.style.transform = "translate(0,-5%)";
createBubbles(svg, newX, newY, newRadius, depth - 1);
}, i * 500);
}
}






Demo

You can try the game by following this link: https://voluble-duckanoo-221094.netlify.app/



Live Coding/Tutorial:

Oh, and if you are interested in watching how I made it; here is a link to the live coding/tutorial:









Estimation Game with Vanilla JavaScript + SVG + Web Audio API [ Live Coding Tutorial ] - YouTube



In this live coding tutorial/journey, we build a Bubble Estimator Game using SVG graphics, recursive functions, and sound effects with JavaScript. We'll crea...



favicon
youtube.com






Source Code:

The source code is available on GitHub: Bubble Estimator Game on GitHub.



I hope this project inspires you to explore new ideas and have fun with your coding journey.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Building the Bubble Estimator Game: A JavaScript Project with SVG and Sound Effects

Thematisch verwandte Begriffe: Building, Bubble, Estimator, Game · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-49449 | Joplin is an open source note-taking and to-do application that organise…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick