Teaching computer programming is an important task in the formation of computer scientists. Being a subject taught in the first years of student degrees, need to properly motivate students, so they try, at home, to learn by themselves, complementing that way their classes. This chapter proposes an approach to computer programming teaching based on the construction of videogames, using state of the art game frameworks. The author will show how the task of writing a game using a common framework deals with the basic programming concepts that are usually taught on a first course on computer programming, namely on object oriented programming languages like C# or Java: algebraic operations with variables, methods declaration, objects definition, objects hierarchy and multidimensional arrays. As it will be shown, even the common order of concepts presentation during the course can be kept, although applying them to computer games instead of the usually requested exercises.