Week 2 in game programming
|
This week we were introduced to a few more things in C++. We learned how to use: functions, arrays, short introduction on how to use rand and srand to produce random values, std::string to print texts and had an introduction to pointers. The last 2 days we focused on creating our very first game from scratch. This was done with a 2 days workshop where our tutor, Tommi Lipponen, wrote code that we copied by writing the same code in Visual Studio. The pong game was created using SDL, which stands for Standard Digitalmedia Library. Below will be an example of some new things introduced during the pong game, enum and struct for example. ”enum” is defined like this: Enumerated types are types that are defined with a set of custom identifiers, known as enumerators, as possible values. Objects of these enumerated types can take any of these enumerators as value. ”struct” is defined like this: A data structure is a group of data elements grouped together under one name. These data elements, known as members, can have different types and different lengths. |
