Educational games

Colobot (Colonize with Bots) is an educational real-time strategy video game featuring 3D graphics. The objective of the game is to prepare 9 fictional planets for colonization by the human race by establishing basic infrastructure on the surface and eliminating any alien life forms endangering the expedition. The main feature of the game which makes it educative is the ability of the player to program his robots using a programming language similar to C++ or Java. (text from Wikipedia )

From the same company

CeeBot is a brand new concept that will introduce you to programming while having fun. The programming language you'll use is very similar to those used by professional programmers to develop their products. CeeBot introduces many modern concepts found in today's most popular environments like C++, C# or Java.
After teaching you the syntax of CeeBot, progressive exercises will lead you to use important concepts such as variables, loops, conditional branching, functions, classes, objects, etc. (text from developer site)