This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Libraries to use. Pygame and system library | |
import pygame, sys, random, time, math | |
from pygame.locals import * | |
#----------------------------------------------- | |
# INITIALISATION | |
#----------------------------------------------- | |
# Set up pygame | |
pygame.init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Item.h" | |
#include <iostream> | |
Item::Item() | |
: Thing() | |
, useable(false) | |
{ | |
} | |
Item::Item(string newName, string newDesc, bool newUseable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Item.h" | |
#include <iostream> | |
Item::Item() | |
: Thing() | |
, useable(false) | |
{ | |
} | |
Item::Item(string newName, string newDesc, bool newUseable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Libraries to use. Pygame and the system library. | |
import pygame, sys | |
from pygame.locals import * | |
# Set up pygame | |
pygame.init() | |
#Set up the window size and title text | |
SCREEN_WIDTH = 1000 | |
SCREEN_HEIGHT = 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Libraries | |
#include <string> | |
#include <iostream> | |
#include <vector> | |
#include "Room.h" | |
// Needed to avoid having to type std:: a lot! | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Libraries | |
#include <string> | |
#include <iostream> | |
#include <vector> | |
#include "Room.h" | |
// Needed to avoid having to type std:: a lot! | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Dog.h" | |
#include <iostream> | |
using namespace std; | |
Dog::Dog() | |
: name("") | |
, breed("") | |
, color("") | |
, coatType("") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <string> | |
using namespace std; | |
class Dog | |
{ | |
public: | |
string name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calcEnemyDPS(t, h): | |
return h/t | |
def calcDamage(e,c): | |
return e * c | |
d = calcDamage(calcEnemyDPS(30,50),2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When we add Dogs to this kennel, they are cloned! (copied in to the vector) | |
vector<Dog> cloningKennel; | |
cloningKennel.push_back(myDog1); | |
cloningKennel.push_back(myDog2); | |
cloningKennel.push_back(myDog3); | |
// Loop through the vector just like we learned before | |
for (int i = 0; i < cloningKennel.size(); ++i) | |
{ |
NewerOlder