A related question: how much would a beginner have to study before being able to write Tetris? As I said, I graduated with a degree in computer engineering without being able to code Tetris, because I have no idea how to write anything except console programs that use cin and cout to do all the input/output work. “Draw something on the screen, and have it move when someone presses a key” would seem to be a fundamental task in computer programming, but apparently it’s some kind of super-advanced topic. :P
The focus on cin / cout as opposed to GUI is probably because cin is simple and always works the same way (mostly because nobody uses it, no need for a zillion libraries), whereas there are a lot of very different GUI libraries with different ways of doing things; learning one of those would take time and not help you use another one much.
If you want to learn yow to make a GUI you can probably find a “hello world” example for your language/os of choice and just copy-paste the code and then adjust it to suit your needs.
It’s not as hard as it might sound. Modern languages have nice libraries and frameworks that make input and basic graphics very easy. Here’s a tutorial for Slick (a Java-based 2D game framework) that walks you through how to do exactly what you ask:
http://slick.cokeandcode.com/wiki/doku.php?id=01_-_a_basic_slick_game
Probably not too long. I wrote (a crappy version of) Breakout in my second semester of high-school programming, and that was using Pascal plus some homebrewed x86 assembler for the graphics (both of which were a nightmare that I wouldn’t recommend to anyone), so simple games clearly don’t require any deep knowledge of the discipline; if you’ve got a computer-engineering background already and you’re working with a modern graphics library, I’d call it a couple weeks of casual study. Less if you’re using a game-specific framework, but those skills don’t usually transfer well to other things.
A related question: how much would a beginner have to study before being able to write Tetris? As I said, I graduated with a degree in computer engineering without being able to code Tetris, because I have no idea how to write anything except console programs that use cin and cout to do all the input/output work. “Draw something on the screen, and have it move when someone presses a key” would seem to be a fundamental task in computer programming, but apparently it’s some kind of super-advanced topic. :P
The focus on cin / cout as opposed to GUI is probably because cin is simple and always works the same way (mostly because nobody uses it, no need for a zillion libraries), whereas there are a lot of very different GUI libraries with different ways of doing things; learning one of those would take time and not help you use another one much.
If you want to learn yow to make a GUI you can probably find a “hello world” example for your language/os of choice and just copy-paste the code and then adjust it to suit your needs.
Yeah… everything is in libraries these days and the libraries are all incompatible with each other. :(
It’s not as hard as it might sound. Modern languages have nice libraries and frameworks that make input and basic graphics very easy. Here’s a tutorial for Slick (a Java-based 2D game framework) that walks you through how to do exactly what you ask: http://slick.cokeandcode.com/wiki/doku.php?id=01_-_a_basic_slick_game
Here’s a tutorial for how to make Tetris: http://slick.cokeandcode.com/wiki/doku.php?id=02_-_slickblocks
I’m sure similar things exist for C++, especially since it’s the most popular language for making games in.
edit: If you want to actually follow one of the above tutorials, see this setup info first: http://slick.cokeandcode.com/wiki/doku.php?id=getting_started_and_setup
Probably not too long. I wrote (a crappy version of) Breakout in my second semester of high-school programming, and that was using Pascal plus some homebrewed x86 assembler for the graphics (both of which were a nightmare that I wouldn’t recommend to anyone), so simple games clearly don’t require any deep knowledge of the discipline; if you’ve got a computer-engineering background already and you’re working with a modern graphics library, I’d call it a couple weeks of casual study. Less if you’re using a game-specific framework, but those skills don’t usually transfer well to other things.