Emmanuel here, cofounder. I won't comment too much on the differences between Knack and Bubble, as I haven't used Knack much. At first sight, I'd say Knack puts the DB at the center of the whole process, while we put the UI and the workflow at the center of it, which we think gives more flexibility.
Gamification-wise, we don't really have a tutorial for this, but it's really about finding the right data structure to represent the 'games', and then have some conditions on the elements and the workflows to change the behavior based on these data points.
Now for the source code question, I can give a few insights here. We don't actually generate code per se, but instead, all apps use the same code base. An app on Bubble is from a technical standpoint an object that describes non ambiguously the design, the workflows, the DB structure, the styles, the plugins that it uses, etc. Now we committed to open source our code if we run out of business (but we don't plan to!! ) and we enable people to extend their app with JS (it's in beta right now, most of the time uses Blockspring blocks, but we'll expose a way at some point). You can read more in our FAQ.