It might not be a good idea to dive directly into the teeworlds code.
Best would be to follow some basic C++ tutorial (well mainly C basics is usually best) and then do some simpler stuff yourself.
http://sol.gfxile.net/gp/index.html is a quite good tutorial on how to get starting with SDL for simple 2D games, it will require you to know some C or C++ though.
EDIT: I would personally recommend learning to program using a framebuffer (you can get one quite easily from SDL) and then drawing individual pixels to it. That's how I learned stuff in the beginning. Should try to port "The Art of Demomaking" to SDL or something 
Languages shapes the way we think, or don't.