|
The second week or introduction to arrays,functions and memory, and this week only, start learning sdl(Simple direct-media layer).
This week has been full of interesting and useful things to learn.
First of is the functions that are the building blocks of programs/classes,constantly being used and reused as well as creating the different things you need to create the program.
Then there is arrays to hold many things in memory instead of having to create a variable for each thing you want to save to a memory location.
And from this we go into Memory, Memory addresses, references, pointers, dynamic memory. A lot of things you need to use in programming. Among these pointers and dynamic memory are very useful and often connected since they are both used to improve the program effectiveness, pointers saving memory space so that not every variable is moved around in the program and dynamic memory that only creates temporary memory location for the variable that later can be deleted and made anew with different size. Dynamic memory is important since you do not have to use a constant if creating an array and that will save a lot of work since you usually want to have a function that creates one but with different size from time to time.
Right sdl do not think I heard about it before this week, apparently is ”Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve’s award winning catalog and many Humble Bundle games”.
So we used it to make a remake of Pong, the old classic where you play to people each controlling a little wall and trying to get a ball past your opponent.

The exercises of the week, though a few has been changed since completion to do them differently or with more details etc.
Exercises week2
SD022-Exercices_-_Week2

About Isak Ekedahl
2014 Programming
|