DEV Community

Cover image for Get Punished For Pressing Space at the Wrong Time
Tayyaba
Tayyaba

Posted on

Get Punished For Pressing Space at the Wrong Time

A few days ago I played Google's Red Light, Green Light game and immediately had the dangerous thought every developer eventually has:

How hard can it be to build something like this?

As it turns out, harder than I expected T-T

I wasn't trying to recreate Google's version or build a perfect Squid Game clone. I just thought it'd be fun to make my own take on the idea and see how much tension I could create from a single button.

The entire game revolves around one action.

Press Space.
Yeah, That's it.

When the light is green, pressing the spacebar moves your contestants closer to the finish line.

When the light is red... someone gets eliminated.

Simple rules. Terrible consequences ;-;

What surprised me while building it was how quickly a basic mechanic became genuinely so stressful. When you're watching the game, it feels easy. When you're playing, you're suddenly staring at the screen waiting for the doll to turn around and wondering if you should risk one more move.

That feeling was what I wanted to capture.

The project started as a small experiment but slowly grew into a proper mini game. I ended up adding animated contestants, a turning doll, randomized red and green phases, sound effects, progress tracking, win and lose screens, mobile support, and a bunch of small visual details that made the whole thing feel more alive.

One of my favorite parts was working on the game flow itself.

The countdown.
The moment the arena lights up.
The switch from green to red.
The instant regret after pressing Space at exactly the wrong time.

Those little interactions ended up being more interesting to build than the movement system itself.

And no, it's definitely not a perfect recreation of Squid Game or Google's version.

It's simply my own interpretation of the classic Red Light, Green Light challenge built with HTML, CSS, JavaScript, and Tailwind CSS.

The funny thing is that while testing it, I probably eliminated more contestants than any real player ever will.

So if you decide to try it, I'd love to know:

How many contestants survive under your command? :o

Live Link: https://notthatslayer.github.io/red-green-light/

Top comments (0)