Daily Archives: November 23, 2014

Pointers and Pong with SDL

Second week the programming course, this week the lectures been about arrays, pointers and how to handle RAM, and this is something I’ve had some trouble getting my head around in the past, pointers and memory allocation that is. I’ve worked with pointers and the new- and delete operators, in the past but never really understood how they work, how I use them or why I should use them.
So if I understood everything right, this is what I’ve learned:
Every time […]

/ Comments Off on Pointers and Pong with SDL
Program: Programming

Pointers and Pong with SDL

Second week the programming course, this week the lectures been about arrays, pointers and how to handle RAM, and this is something I’ve had some trouble getting my head around in the past, pointers and memory allocation that is. I’ve worked with pointers and the new- and delete operators, in the past but never really understood how they work, how I use them or why I should use them.
So if I understood everything right, this is what I’ve learned:
Every time […]

/ Comments Off on Pointers and Pong with SDL
Program: Programming

Pointers and Pong with SDL

Second week the programming course, this week the lectures been about arrays, pointers and how to handle RAM, and this is something I’ve had some trouble getting my head around in the past, pointers and memory allocation that is. I’ve worked with pointers and the new- and delete operators, in the past but never really understood how they work, how I use them or why I should use them.
So if I understood everything right, this is what I’ve learned:
Every time […]

/ Comments Off on Pointers and Pong with SDL
Program: Programming

Pointers and Pong with SDL

Second week the programming course, this week the lectures been about arrays, pointers and how to handle RAM, and this is something I’ve had some trouble getting my head around in the past, pointers and memory allocation that is. I’ve worked with pointers and the new- and delete operators, in the past but never really understood how they work, how I use them or why I should use them.
So if I understood everything right, this is what I’ve learned:
Every time […]

/ Comments Off on Pointers and Pong with SDL
Program: Programming

Programming – Week 2

Another week of programming has come to an end, and LOTS of new things has been introduced. We have been introduced to functions, arrays, references and pointers, how to use rand and srand to produce a random number. As you can see, lots of things. During thursday and friday we also had a workshop where we went through the code for the classic game Pong. This was done by using Visual Studio and SDL, which stands for Standard Digital media Library.
In the […]

/ Comments Off on Programming – Week 2
Program: Programming

Programming – Week 2

Another week of programming has come to an end, and LOTS of new things has been introduced. We have been introduced to functions, arrays, references and pointers, how to use rand and srand to produce a random number. As you can see, lots of things. During thursday and friday we also had a workshop where we went through the code for the classic game Pong. This was done by using Visual Studio and SDL, which stands for Standard Digital media Library.
In the […]

/ Comments Off on Programming – Week 2
Program: Programming

Programming – Week 2

Another week of programming has come to an end, and LOTS of new things has been introduced. We have been introduced to functions, arrays, references and pointers, how to use rand and srand to produce a random number. As you can see, lots of things. During thursday and friday we also had a workshop where we went through the code for the classic game Pong. This was done by using Visual Studio and SDL, which stands for Standard Digital media Library.
In the […]

/ Comments Off on Programming – Week 2
Program: Programming

Programming – Week 2

Another week of programming has come to an end, and LOTS of new things has been introduced. We have been introduced to functions, arrays, references and pointers, how to use rand and srand to produce a random number. As you can see, lots of things. During thursday and friday we also had a workshop where we went through the code for the classic game Pong. This was done by using Visual Studio and SDL, which stands for Standard Digital media Library.
In the […]

/ Comments Off on Programming – Week 2
Program: Programming

Thumbnails – Clash of heavens

/ Comments Off on Thumbnails – Clash of heavens
Program: Graphics

Thumbnails – Clash of heavens

/ Comments Off on Thumbnails – Clash of heavens
Program: Graphics

Thumbnails – Clash of heavens

/ Comments Off on Thumbnails – Clash of heavens
Program: Graphics

Thumbnails – Clash of heavens

/ Comments Off on Thumbnails – Clash of heavens
Program: Graphics

Week of fail

Have been trying to get the DirectX 11 to work with visual studio. somehow I couldn’t open the #pragma comment (lib, “d3dx11.lib”). something I really need. I later fixed it but got another error,   LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup. Found the problem later on, had to change the subsystem in the properties. More than that, I just read up on the different functions I will be using in DirectX.
Also this week I tried to download  […]

/ Comments Off on Week of fail
Program: Programming

Week of fail

Have been trying to get the DirectX 11 to work with visual studio. somehow I couldn’t open the #pragma comment (lib, “d3dx11.lib”). something I really need. I later fixed it but got another error,   LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup. Found the problem later on, had to change the subsystem in the properties. More than that, I just read up on the different functions I will be using in DirectX.
Also this week I tried to download  […]

/ Comments Off on Week of fail
Program: Programming

Second week of Game Programming 1 – Pong

This week we got introduced to our first session of game programming. We got introduced to SDL(Simple DirectMedia Library), the library we will be using in the course to create our own games. The game we got to work on and experiment with was Pong. Pong is a game simulating a game of table tennis. Our task was to implement movement and collision, it was a great task to get a feeling of how a basic game structure looks. However the code […]

/ Comments Off on Second week of Game Programming 1 – Pong
Program: Programming

Second week of Game Programming 1 – Pong

This week we got introduced to our first session of game programming. We got introduced to SDL(Simple DirectMedia Library), the library we will be using in the course to create our own games. The game we got to work on and experiment with was Pong. Pong is a game simulating a game of table tennis. Our task was to implement movement and collision, it was a great task to get a feeling of how a basic game structure looks. However the code […]

/ Comments Off on Second week of Game Programming 1 – Pong
Program: Programming

Programming – Week 2

This week we worked with pointers in C++. You create a pointer by adding a
” * ” at the end of the data type. Pointers works just like the name describes, it points towards a memory address instead of a value. To access a variables memory address you add ” & ” in front of the variable name. To access the value of a pointer you can use ” * ” in front of the pointer variable.
This is an example […]

/ Comments Off on Programming – Week 2
Program: Programming

Programming – Week 2

This week we worked with pointers in C++. You create a pointer by adding a
” * ” at the end of the data type. Pointers works just like the name describes, it points towards a memory address instead of a value. To access a variables memory address you add ” & ” in front of the variable name. To access the value of a pointer you can use ” * ” in front of the pointer variable.
This is an example […]

/ Comments Off on Programming – Week 2
Program: Programming

Programming – Week 2

This week we worked with pointers in C++. You create a pointer by adding a
” * ” at the end of the data type. Pointers works just like the name describes, it points towards a memory address instead of a value. To access a variables memory address you add ” & ” in front of the variable name. To access the value of a pointer you can use ” * ” in front of the pointer variable.
This is an example […]

/ Comments Off on Programming – Week 2
Program: Programming

Programming – Week 2

This week we worked with pointers in C++. You create a pointer by adding a
” * ” at the end of the data type. Pointers works just like the name describes, it points towards a memory address instead of a value. To access a variables memory address you add ” & ” in front of the variable name. To access the value of a pointer you can use ” * ” in front of the pointer variable.
This is an example […]

/ Comments Off on Programming – Week 2
Program: Programming

Programming: Week 2 (cont.)

Ex. 10
Write a program that generates a random symbolic game map that contains characters. Use the following characters:
# represents a wall
& represents a tree
_ represents walkable area
This one is simple. Since we need to randomly choose one of 3 options, we generate an integer from the interval [0;2] (or [1;3], it doesn’t change anything).

#include
#include
#include

int random()
{
return rand() % 2;
}

int main(int argc, char* argv[]){

std::cout << std::endl;
srand((unsigned int)time(0));
for (int i = 0; i < 9; i++)
{
std::cout << " ";
for […]

/ Comments Off on Programming: Week 2 (cont.)
Program: Programming

Programming: Week 2 (cont.)

Ex. 10
Write a program that generates a random symbolic game map that contains characters. Use the following characters:
# represents a wall
& represents a tree
_ represents walkable area
This one is simple. Since we need to randomly choose one of 3 options, we generate an integer from the interval [0;2] (or [1;3], it doesn’t change anything).

#include
#include
#include

int random()
{
return rand() % 2;
}

int main(int argc, char* argv[]){

std::cout << std::endl;
srand((unsigned int)time(0));
for (int i = 0; i < 9; i++)
{
std::cout << " ";
for […]

/ Comments Off on Programming: Week 2 (cont.)
Program: Programming

Week 2

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 […]

/ Comments Off on Week 2
Program: Programming

Week 2

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 […]

/ Comments Off on Week 2
Program: Programming