There have been a few attempts to do this before but none appear to really have taken off in the home market. Fitcentric had sensor kits that you could retrofit to exercise machines to enable them to be used with the NetAthalon product, and more recently Big Ben Interactive brought out the Cyber Bike for the Wii console, however it only appeared to work with the one supplied cycling game and optionally with Mario Kart which perhaps limited its appeal.
As I build idea I was thinking of Ben's team starting off with an ordinary bicycle, removing the rear wheel and replacing it with a flywheel + dynamo to provide resistance level either controlled via game play or through an on-board microcontroller so as you could load the resistance data from a file, use an optional heart rate monitor belt (e.g. Polar) to control resistance setting or just plain old manual up/down settings.
By starting off with a bicycle rather than an existing exercise bike it should make it easier for people to replicate the build. The frame will also allow people to customise it with a wide range of off-the shelf saddles, pedals etc.
The microcontroller would be configurable to work stand-alone or to emulate various games console controllers. Not all games will likely be appropriate but ones with forward/back left/right type operations should be a starting point. There was the cycling game for Wii Fit+ which was quite fun apart from having to 'air pedal' on the balance board. Some of the retro games driving games might work where you have a throttle and steering.
However as well as a universal games controller one could perhaps look at hooking the microcontroller up to use the likes of Google Street View to allow you to cycle through Street View maps and to get the imagery appearing to make the exercise more interesting. Perhaps it is a route you might want to cycle in real life at some point and you want to train for it. I think the API also produces height information so this is an example of where the game could automatically vary the resistance level based on change in altitude over distance.
In addition a video playback mode where you load up a video file on SD card along with an optional resistance profile so you have something a bit more interesting to watch than the usual flashing LEDs you get on most home exercise bikes. The videos could be fitness motivator type videos, actioncam / dashcam / drone footage.
Finally have a HID USB controller mode which allows it to be used with the likes of Scratch programming etc. so as kids can join in and start writing their own interactive fitness-oriented games.