Relearning web development by writing a clicking game using React, Npm and Browserify
I had some free time this vacation, and came across this interesting little sandbox game called Pokemon or BigData by pixelastic.
browserify -t [ babelify --presets [ react ] ] app/index.jsx -o app/public/bundle.js
The aesthetics of the code are clean and simple. It uses React, which seems to be used for real-time web UIs. It also uses npm as a package manager. My previous forays into async calls in web dev were not nearly as pretty, so this seems like a good opportunity to learn something new.
I decided a fun first start would be a simple game, and the simplest game I could think of was clicking a button to make a count go up. To give it some real-time feedback, I added some upgrade buttons that automatically click for you, a common incremental game technique.
The heart of the code is basically a state machine that contains the current number of clicks and the number of upgrades bought.