Weekly programming – The “client” concept (v49)
I’d like to describe a concept connected to code structure this week. I was introduced to this concept in a book I’m currently reading called “More Effective C++: 35 ways to improve your programs and designs” by Scott Meyers. It’s an optional book for our current course in programming.
The concept in a nutshell is making classes with it’s “clients” in mind. Clients are the programmers (perhaps yourself included) and other classes or parts of the code that will use the said class. You might […]
Weekly programming – The “client” concept (v49)
I’d like to describe a concept connected to code structure this week. I was introduced to this concept in a book I’m currently reading called “More Effective C++: 35 ways to improve your programs and designs” by Scott Meyers. It’s an optional book for our current course in programming.
The concept in a nutshell is making classes with it’s “clients” in mind. Clients are the programmers (perhaps yourself included) and other classes or parts of the code that will use the said class. You might […]
Weekly programming – The “client” concept (v49)
I’d like to describe a concept connected to code structure this week. I was introduced to this concept in a book I’m currently reading called “More Effective C++: 35 ways to improve your programs and designs” by Scott Meyers. It’s an optional book for our current course in programming.
The concept in a nutshell is making classes with it’s “clients” in mind. Clients are the programmers (perhaps yourself included) and other classes or parts of the code that will use the said class. You might […]
Weekly programming – The “client” concept (v49)
I’d like to describe a concept connected to code structure this week. I was introduced to this concept in a book I’m currently reading called “More Effective C++: 35 ways to improve your programs and designs” by Scott Meyers. It’s an optional book for our current course in programming.
The concept in a nutshell is making classes with it’s “clients” in mind. Clients are the programmers (perhaps yourself included) and other classes or parts of the code that will use the said class. You might […]
Cleaning the character
This week I have worked with making the character that i drew last week look clean. That means that you clean up the lines in the character. Right now they look quite sketchy and the lines are thick and not very precise. Here is the character that I drew last week.
As you can see in the character to the right he looks quite clean at a first look but if you look closer you can see that the lines […]
Cleaning the character
This week I have worked with making the character that i drew last week look clean. That means that you clean up the lines in the character. Right now they look quite sketchy and the lines are thick and not very precise. Here is the character that I drew last week.
As you can see in the character to the right he looks quite clean at a first look but if you look closer you can see that the lines […]
GAME PROGRAMMING I: WEEK FOUR
This week we have been working on a version of Arkanoid, a game where the objective is to destroy blocks with a ball while controlling a paddle.
We have also started our course project where we are to create a clone of a classic game. I have selected to create a clone of The Legend Of Zelda.
To start I have to break down the game to find out what objects are in the game, what properties and behaviours the objects have, […]
GAME PROGRAMMING I: WEEK FOUR
This week we have been working on a version of Arkanoid, a game where the objective is to destroy blocks with a ball while controlling a paddle.
We have also started our course project where we are to create a clone of a classic game. I have selected to create a clone of The Legend Of Zelda.
To start I have to break down the game to find out what objects are in the game, what properties and behaviours the objects have, […]
Programming: Week 3 (cont.)
Ex. 3
Write a TemperatureConverter class that handles conversions between Celsius, Fahrenheit and Kelvin. Each conversion mode should have its dedicated method; the user should be able to choose which conversion mode to use.
Here is the program:
#include
#include
#include
class TemperatureConverter
{
public:
void SetTemp(std::string input)//set methods – provide data entered by the user to the Class
{
int n = input.length();
char sist = input.at(n – 1);
float temp_part = std::stof(input.erase(n – 1, 1));
temperature = temp_part;
};
void SetSource(std::string input)
{
int n = input.length();
char sist = input.at(n – 1);
source = […]
Programming: Week 3 (cont.)
Ex. 3
Write a TemperatureConverter class that handles conversions between Celsius, Fahrenheit and Kelvin. Each conversion mode should have its dedicated method; the user should be able to choose which conversion mode to use.
Here is the program:
#include
#include
#include
class TemperatureConverter
{
public:
void SetTemp(std::string input)//set methods – provide data entered by the user to the Class
{
int n = input.length();
char sist = input.at(n – 1);
float temp_part = std::stof(input.erase(n – 1, 1));
temperature = temp_part;
};
void SetSource(std::string input)
{
int n = input.length();
char sist = input.at(n – 1);
source = […]
6.12.14
Den här veckan har vi börjat ordentligt med spelprogrammering. Vi har kört mycket live kodning, att handledaren har skrivit och vi har skrivit av så vi har kunnat gå igenom rad för rad och se hur man bygger upp ett spel. Vi håller på med att återskapa arkanoid men vi är ännu inte riktigt klara, hittills har vi bara som en fungerande mall för att göra ett spel. Något som vi kommer ha användning av i framtiden! Och det är […]
6.12.14
Den här veckan har vi börjat ordentligt med spelprogrammering. Vi har kört mycket live kodning, att handledaren har skrivit och vi har skrivit av så vi har kunnat gå igenom rad för rad och se hur man bygger upp ett spel. Vi håller på med att återskapa arkanoid men vi är ännu inte riktigt klara, hittills har vi bara som en fungerande mall för att göra ett spel. Något som vi kommer ha användning av i framtiden! Och det är […]
Clean line
This week we continue to work with our character and our assignment was to clean up the character and give it clean lines.
I rushed it a bit since I did not plan my work too good.
This is how it turned out.
Clean line
This week we continue to work with our character and our assignment was to clean up the character and give it clean lines.
I rushed it a bit since I did not plan my work too good.
This is how it turned out.
Clean line
This week we continue to work with our character and our assignment was to clean up the character and give it clean lines.
I rushed it a bit since I did not plan my work too good.
This is how it turned out.
Clean line
This week we continue to work with our character and our assignment was to clean up the character and give it clean lines.
I rushed it a bit since I did not plan my work too good.
This is how it turned out.
Programming 3 Lighting
Hello, this week we have been going through how to properly render something in dirextX, there are several things to be considered. In my recent post I talked about creating a box and how we calculate it. But in order to make our box act as if it were in the real world there are a few things we must code, a light source is one major aspect in order to get an object to feel more real.
In directX there […]
Programming 3 Lighting
Hello, this week we have been going through how to properly render something in dirextX, there are several things to be considered. In my recent post I talked about creating a box and how we calculate it. But in order to make our box act as if it were in the real world there are a few things we must code, a light source is one major aspect in order to get an object to feel more real.
In directX there […]
Programming 3 Lighting
Hello, this week we have been going through how to properly render something in dirextX, there are several things to be considered. In my recent post I talked about creating a box and how we calculate it. But in order to make our box act as if it were in the real world there are a few things we must code, a light source is one major aspect in order to get an object to feel more real.
In directX there […]
Programming 3 Lighting
Hello, this week we have been going through how to properly render something in dirextX, there are several things to be considered. In my recent post I talked about creating a box and how we calculate it. But in order to make our box act as if it were in the real world there are a few things we must code, a light source is one major aspect in order to get an object to feel more real.
In directX there […]
Halvfungerande 5 kort pokersimulator
Skiljer mellan poänghänder, men inte mellan olika valörer av samma typ av poänghand (förutom olika ”High cards”)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//main
#include
#include
#include ”validate.h”
#include ”card.h”
#include ”deck.h”
#include ”hand.h”
int main(int argc, char* argv[])
{
Deck deck;
Card card;
Validate validate;
Hand playerOne;
Hand playerTwo;
int PlayerOneScore = 0;
int PlayerTwoScore = 0;
for (int i = 0; i != 4;)
{
std::cout << ”1. Shuffle (recommended) n2. Play two player match! n3. Display score nExit” << std::endl; // menu
std::cin >> i;
switch (i)
{
case 1:
{
deck.Shuffle(); // shuffle
std::cout << ”Shuffled..” << std::endl;
break;
}
case 2:
{
std::cout << ”Dealing.. ” << std::endl; //deal cards
for […]
Halvfungerande 5 kort pokersimulator
Skiljer mellan poänghänder, men inte mellan olika valörer av samma typ av poänghand (förutom olika ”High cards”)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//main
#include
#include
#include ”validate.h”
#include ”card.h”
#include ”deck.h”
#include ”hand.h”
int main(int argc, char* argv[])
{
Deck deck;
Card card;
Validate validate;
Hand playerOne;
Hand playerTwo;
int PlayerOneScore = 0;
int PlayerTwoScore = 0;
for (int i = 0; i != 4;)
{
std::cout << ”1. Shuffle (recommended) n2. Play two player match! n3. Display score nExit” << std::endl; // menu
std::cin >> i;
switch (i)
{
case 1:
{
deck.Shuffle(); // shuffle
std::cout << ”Shuffled..” << std::endl;
break;
}
case 2:
{
std::cout << ”Dealing.. ” << std::endl; //deal cards
for […]
Weak four (on my part)
This week has been purely about how to use the SDL library and about dividing things into appropriate classes as a foundation of games. That means we have one class for starting everything, one class for drawing everything on the screen, one class for handling states, etc… We learned to handle input from mouse and keyboard, we learned how to make a core loop of clearing screen drawing screen and presenting screen and lastly we larned about states, which was […]
Weak four (on my part)
This week has been purely about how to use the SDL library and about dividing things into appropriate classes as a foundation of games. That means we have one class for starting everything, one class for drawing everything on the screen, one class for handling states, etc… We learned to handle input from mouse and keyboard, we learned how to make a core loop of clearing screen drawing screen and presenting screen and lastly we larned about states, which was […]