During a workshop at LOREM, we stumbled upon a pseudo-analog version of the infamous Flappy Bird using a few parts. Or something like a 1D version of the Tron motorbike race :-D
Nothing fancy, no automatic obstacle detection (you have to do it yourself :-P) and the user interface is... minimalistic at best.
For more electronic workshops ideas, look at #Electronics Workshops Resources
Take your favorite 2-traces DSO, set the speed at a reasonably low level (1s/cm) and tie a potentiometer to channel 2. Set the input range from 0V to Vbattery to fill the screen. You can already "draw" on the screen with this :-)
We were working with 1µF and 1MOhms so the time constant (or slope) is about 1s.
We were not intending to play, just look at the behaviour of another circuit (to be logged soon). One button press discharges the capacitor, another press charges it. Shake, stir and let the rest unfold !
How can we make a better Flappy game ?
Let's start with the fall. I admit that a capacitor's discharge curve is a lousy approximation for a parabola but we'll accept it.
So we have the "altitude" capacitor, here C1=1µF, with a "gravity" pull-down resistor (R1=1M) to discharge it. The 'scope is connected there as well and contributes to its discharge (through RSCOPE) so the probe must be set to 10× (giving an approximate resistance to ground of 900K). The gravity could be tuned with a potentiometer in series with R1.
This can only discharge the capacitor, emulating a non-newtonian world. How is it possible to climb ?
One simple solution is to use a push-button to enable a pull-up resistor (let's say 100K) but this would not emulate the "gameplay" since the duration of the buttonpress would allow a precise modulation of the "height".
Each keypress should increase the height by only a discrete, fixed amount. This quantum can be stored by another charge-holding capacitor, that gets charged by +Vcc and discharged into C1.
To increase the "height" (voltage) by 1/10 of the range, C2 must be 1/10 the capacity of C1. In this case, we have the convenient value of 100nF. It also works with C1/5=200nF, or two 100nF capacitors in parallel (see what I did ? we talk about parallelled capacitors)
A series resistor limits the inrush current. 100 to 1K Ohms (1/1000th of the gravity resistor) should work. This is optional.
With one simple, cheap circuit, we have covered: charge pumps, sample & hold, RC
time, Capacitor voltage dividers, PWM modulation and many other mundane
details, in a very beginner-friendly circuit ! A few modifications lead to the little introduction to sigma-delta ADCs.