I started writing a game and have errors that I cant find. The intellisens wont point them out either. I have reinstalled all the needed software to find the same results. Im stuck can someone please tell me whats going on, I would like to bring this thing to life! Its only 4 errors that deal with linking, but Im stumped! Thanks in advance!!!
#ifndef SPRITES_H
#define SPRITES_H
class Sprites {
public:
Sprites(); // Constructor
// Create Leonardo and all his moves
void LeonardoSprites();
// Leonardo sprites
void sideKick();
void swordWalk();
void swordThrust();
void handWalk();
void doubleChop();
void swordDraw();
private:
int spriteNumber;
};
#endif
#include "DarkGDK.h"
#include "Sprites.h"
//Constructor
Sprites::Sprites() {
}
//Create all Leonardo sprites and set there sizes
void Sprites::LeonardoSprites() {
// Leonardo_Standing Sprite #22, 4 frames long 1 frame deep
dbCreateAnimatedSprite( 22, "Leonardo_Standing.png", 4, 1, 22 );
dbSizeSprite ( 22, 150, 275 ); // Leonardos size
// Leo_Sword_Draw Sprite #23, 4 frames long 1 frame deep
dbCreateAnimatedSprite( 23, "Leo_Sword_Draw.png", 4, 1, 23);
dbSizeSprite ( 23, 150, 275 ); // Leonardos size
// Leo_Sword_Walk Sprite #24, 4 frames long 1 frame deep
dbCreateAnimatedSprite( 24, "Leo_Sword_Walk.png", 4, 1, 24);
dbSizeSprite ( 24, 150, 275 ); // Leonardos size
// Leo_Kicks Sprite #25, 3 frames long 1 frame deep
dbCreateAnimatedSprite( 25, "Leo_Kicks.png", 3, 1, 25);
dbSizeSprite ( 25, 150, 275 ); // Leonardos size
// Leo_Sword_Thrust Sprite #26, 3 frames long 1 frame deep
dbCreateAnimatedSprite( 26, "Leo_Sword_Thrust.png", 3, 1, 26);
dbSizeSprite ( 26, 175, 300 ); // Leonardos size
// Leo_Dubble_Chop Sprite #27, 5 frames long 1 frame deep
dbCreateAnimatedSprite( 27, "Leo_Dubble_Chop.png", 5, 1, 27);
dbSizeSprite ( 27, 175, 300 ); // Leonardos size
}
// Leonardo sprites
// Play sprite handWalk
void Sprites::handWalk() {
dbPlaySprite( 22, 1, 4, 200 );
}
// Play sprite swordDraw
void Sprites::swordDraw() {
dbPlaySprite( 23, 1, 4, 200 );
}
// Play sprite swordWalk
void Sprites::swordWalk() {
dbPlaySprite( 24, 1, 4, 200 );
}
// Play sprite sideKick
void Sprites::sideKick() {
dbPlaySprite( 25, 1, 2, 200 );
}
// Play sprite swordThrust
void Sprites::swordThrust() {
dbPlaySprite( 26, 1, 3, 130 );
}
// Play sprite doubleChop
void Sprites::doubleChop() {
dbPlaySprite( 27, 1, 5, 130 );
}
//#include "DarkGDK.h"
#include "Character.h"
// Constructor
Character::Character( const string &charName, int bHealth, int cHealth,
int hitAmount, int hitResistance, int currentAction,
int currentSpeed, int xPosition, int yPosition )
: characterName( charName ), baseHealth( bHealth ),
currentHealth( cHealth ), dammage( hitAmount ),
toughness( hitResistance ), action( currentAction ),
speed( currentSpeed ), x( xPosition ), y( yPosition )
{
setPosition( x, y );
}
// Set the characters name
void Character::setCharacterName( const string &charName ) {
characterName = charName;
}
// Get the characters name
string Character::getCharacterName() const {
return characterName;
}
// Set the characters base health
void Character::setBaseHeath( int bHealth ) {
baseHealth = bHealth;
}
// Get the characters base health
int Character::getBaseHeath() {
return baseHealth;
}
// Set the characters current health
void Character::setCurrentHeath( int cHealth ) {
currentHealth = cHealth;
}
// Get the characters current health
int Character::getCurrentHeath() {
return currentHealth;
}
// Set the characters amount of dammage that can be done
void Character::setDammage( int hitAmount ) {
dammage = hitAmount;
}
// Get the characters amount of dammage that can be done
int Character::getDammage() {
return dammage;
}
// Set the characters amount of resistance to dammage
void Character::setToughness( int hitResistance ) {
toughness = hitResistance;
}
// Get the characters amount of resistance to dammage
int Character::getToughness() {
return toughness;
}
// Set the characters action
void Character::setAction( int currentAction ) {
action = currentAction;
}
// Get the characters action
int Character::getAction() {
return action;
}
// Set the characters speed
void Character::setSpeed( int currentSpeed ) {
speed = currentSpeed;
}
// Get the characters speed
int Character::getSpeed() {
return speed;
}
// Set the characters X position
void Character::setX( int xPosition ) {
x = xPosition;
}
// Get the characters X position
int Character::getX() {
return x;
}
// Set the characters Y position
void Character::setY( int yPosition ) {
y = yPosition;
}
// Get the characters Y position
int Character::getY() {
return y;
}
// Set the characters position on screen
void Character::setPosition( int xPosition, int yPosition ) {
setX( xPosition );
setY( yPosition );
}
#ifndef CHARACTER_H
#define CHARACTER_H
#include "Sprites.h" // Sprite class declaration
#include <string>
using std::string;
class Character : public Sprites {
public:
// Constructor
Character( const string &, int = 0, int = 0, int = 0,
int = 0, int = 0, int = 0, int = 0, int = 0 );
// Character name functions
void setCharacterName( const string &);
string getCharacterName()const;
// Character health functions
void setBaseHeath( int );
int getBaseHeath();
void setCurrentHeath( int );
int getCurrentHeath();
void setDammage( int );
int getDammage();
void setToughness( int );
int getToughness();
// Character positon functions
void setX( int ); // Set X axis position
int getX(); // Return X axis position
void setY( int ); // Set Y axis position
int getY(); // Return X axis position
void setPosition( int, int ); // Set character position on screen
int getPosition(); // Get character position on screen
// Character action functions
void setAction( int );
int getAction();
// Character speed functions
void setSpeed( int );
int getSpeed();
private:
string characterName; // Characters name
int baseHealth; // Start health
int currentHealth; // Health after hit
int dammage; // Dammage done by a hit
int toughness; // Resistance to damage
int action; // Action to be performed
int speed;
int x; // X axis position
int y; // Y axis position
};
#endif
//#include "DarkGDK.h"
#include "Leonardo.h"
// Constructor explicitly calls base class constructor
Leonardo::Leonardo( const string &charName, int bHealth, int cHealth, int hitAmount,
int hitResistance, int currentAction, int currentSpeed,
int xPosition, int yPosition )
// Explicitly call base class constructor
: Character( charName, bHealth,
cHealth, hitAmount, hitResistance, currentAction, currentSpeed,
xPosition, yPosition ) {
}
#ifndef LEONARDO_H
#define LEONARDO_H
#include "Character.h" // Include the base class
class Leonardo : public Character {
public:
Leonardo( const string &, int = 0, int = 0, int = 0,
int = 0, int = 0, int = 0, int = 0, int = 0 ); // Default constructor
//int getAction();
private:
};
#endif
#include "DarkGDK.h"
#include "Leonardo.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
// Instantiate Leonardo object
Leonardo leo( "Leonardo", 100, 100, 100, 10, 4, 4, 200, 200 );
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
// our main loop
while ( LoopGDK ( ) )
{
// update the screen
dbSync ( );
}
// return back to windows
return;
}