Interactive programming Flappy Bird in ClojureScript

Channel:Bruce Hauman · Length:6:22 · Published:2014-04-29 · Views:55109

Watch on YouTube

Summary

Bruce Hauman live-codes Flappy Bird in ClojureScript in about six minutes, using figwheel to hot-reload changes into the running game. The demo shows game behavior being changed interactively without restarting.

Why HN recommends it

It is the canonical demo HN people cite for live interactive development and hot reloading, as proof the workflow is real and not smoke and mirrors.

I still marvel at Bruce Hauman's demo — HN, 2016

Functional programming · Web development · Game programming & engines

Subtitles (excerpt)

I wrote a linan plugin called fig wheel that pushes compiled closure script to the browser so that you can basically do interactive programming I'm I'm going to do a little demo and something you notice while I'm doing it is that I am not reloading the browser and that all the changes are happening as I save my closure script file another thing to notice is that the program is right running and that all the changes are being applied to the running stateful program so first let's change a little Dom and see how quickly changes get applied so I'm changing the button from do art to start and it just happened immediately let's change it back to Art save the file and again we get it back start is a much better name so we can just eliminate the button it's gone eliminate save it's back so if we start the program here we see Flappy Bird and Flappy Bird is not oscillating and in the real game right here a Flappy Bird before you actually start playing he's oscillating so let's go add that functionality to the game we're going to go up here to the top where I up dat the bird and we're going to create a function called sine wave it's key so we're going to base the sine wave on the time Delta keep a reference to the

On Hacker News

I don't disagree with the article, but I also don't know that pushing the boundaries of interactivity and "fun" are relegated to academia. Iterating on what makes things fun is (probably) highly unscientific and might be better left to people more focused on it directly, such as game programmers. As far as interactive development of games goes, I still marvel at Bruce Hauman's demo[1] of "Interac… — nprescott, 2016-07
From my standpoint as a one man show, it's invaluable to be able to write the web client and backend in the same language, to share code between them... and have that one language NOT be JS. Clojurescript with Rum/Citrus or Reagent/Reframe deliver on the promise of React/Redux with much less fuss and overhead. Editing JSX is a pain in comparison to the Hiccup syntax used more often in CLJS, e.g. … — Nihilartikel, 2020-07
One of the best things about ClojureScript is figwheel and realtime programming. You can see it in action here [VIDEO] — LandR, 2019-11
I'm not sure if the parent did, but I followed what you were looking for and the answer is still "try clojure", perhaps more specifically it is "Try the Clojure libraries figwheel and devcards to do web stuff" but the push for immediate feedback and "interactive programming" is central for everyone. It's a community that took Bret Victor's Inventing on Principle talk to heart, already agreeing du… — freshhawk, 2017-07
If you're starting from from scratch it looks really awesome. No callback hell and in believable tooling. Watch these talks to see what I mean about tooling: Few minutes [VIDEO] Longer [LINK] — base698, 2015-09

Related videos