You are browsing as a guest. Sign up (or log in) to start making projects!

Beat It

  • 1 Devlogs
  • 16 Total hours

A rythm based game that takes in an MP3 file from your computer to make it into a Bike riding level so cool

Ship #1 Pending review

This is a rythm based Game that takes in MP3 Music files from your PC and turns it into a level through which you speed through on your bike.
It stated when i was playing “Dancing line” - a mobile game that also turns a song into levels although they are pre made and that makes it unadaptable to a song that i want to play the game with. In order to fix it I made a full audio analysis and beat detection system with local energy based beat detection.
It took a LOT of fine tuning to get the beats to be placed right for most songs but i feel it now does it reliably.
This is just V1 of the project next will be a fast fourier transform algorithm that will dissect an audio file to its absolute origins and get the more than enough data to build a good level.
Again this is the Demo for the project. Its still under development!
I hope you have fun playing it, read the Readme File or the itch.io description to get an idea of the controls!
Now go and BEAT IT

  • 1 devlog
  • 16h
Try project → See source code →
Open comments for this post

16h 19m 39s logged

BEAT IT

Your music is the level.

A synthwave motorcycle runner where the road, the collectibles, and the traffic are all generated from a song you actually own. Drop in any MP3, and the game listens to it — beat by beat — to build a highway that only exists because that specific track does.

What it actually does

Import any MP3. The game reads it, finds the beats, and figures out roughly where the melody rises and falls.
A road gets built to match: collectible beat blocks land exactly on the drum hits, and the path between them curves in the direction the melody moves.
Traffic weaves through the level too — some of it sitting directly on your line, forcing an actual choice between chasing a streak and swerving to survive.
Get clipped by a car and the screen reddens instead of ending the run outright. Get clipped enough times in a row without recovering, and it does.
Survive the whole song, and the camera holds still while the bike rides off toward the horizon on its own.

How to play

Controls: A/D or Left/Right to weave across the road.

Your music: On first launch, hit Play, then “Open Songs Folder” on the song select screen. Drop your MP3s in, back out to the main menu, hit Play again to refresh the list.

The story behind it

This started as a design doc for something I genuinely didn’t know how to build. I’d never touched audio analysis before — I knew Unity, I knew C#, and I had a pretty clear picture of the feeling I wanted (weaving through a highway that’s actually reacting to the song you picked), but the actual how of “read an MP3 and find the beat” was a total blank.

So I built it the only way that made sense: one small, testable piece at a time. Load the file. Confirm you can actually read the raw samples back out — and immediately learn the hard way that array indices and seconds-into-the-song are not the same scale when your audio is stereo and interleaved. Get a single number (energy in a window) that’s louder on a kick drum than on silence. Watch it also light up on vocals and melody, because raw loudness doesn’t know the difference between a kick and a chorus — and go learn what a low-pass filter actually does about that. Watch beats land audibly late, and find out that’s because you’re timestamping the start of a window instead of hunting for the actual peak inside it. Rebuild the whole detector around change in energy instead of raw energy, because a sustained bassline was getting picked up as a wall of false beats a flat threshold could never tell apart from a real hit.

The design itself changed shape more than once, too. The original plan kept the bike frozen in place with the whole world scrolling past it, specifically to dodge floating-point drift over a long run. Then a simple particle trail on the bike broke that illusion completely — a trail can’t read as “moving forward” if the thing it’s attached to never actually moves — so the bike started really driving, and the “drift” problem I’d been defending against turned out to not even apply once I did the math on how far a single song could actually carry it. A whole planned system (recycling road tiles forever) got deleted the moment I realized every level is scoped to one finite, fully-known-in-advance song — there’s no “forever” to build for.

The traffic system is maybe my favorite piece of this, honestly. Cars aren’t just scattered around — they’re placed by solving backwards: given exactly where and when I want a near-miss to happen, and how fast the car should be going, what starting position makes that car arrive there right on cue? Same trick the beat blocks use for their own placement, just pointed at a different problem.

Tech

No third-party DSP libraries — the beat and melody detection are hand-rolled: single-pole low-pass/band-pass filtering, spectral-flux-style onset detection, and a lightweight spectral-centroid approximation for melody direction, all built directly on raw AudioClip sample data

0
1
43

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…