I tried to write a simple game and I accidently got errors

> 
> "No matching function for call to Monster::Monster()"
> 
> 
> 

and

> 
> "No matching function for call to Player::Player()".
> 
> 
> 

Both were for the Game class constructor. Class Game is not related to classes Monster or Player in any way. Here are the codes.

main.cpp

```
#include <game.h>

#include <iostream>

using namespace std;

int main() {
    Game game = Game( );
    while(!game.hasFinished( )) {
        game.round( );
    }
}

```

game.h

```
#ifndef GAME
#define GAME
#include <entity.h>

class Game {
    private:
        bool finished = false;

        char area[15][15];
        char defaultSign = '*';
        int size = 15;

        Monster monsters[4];
        Player player;

        int score = 0;

        void cls();
        void fill();
        void display();

        void playerMove();
    public:
        Game();
        void round();

        int getScore();
        bool hasFinished();
};

#endif

```

game.cpp

```
#include <game.h>

#include <iostream>
#include <conio.h>

Game::Game() {
    player = Player(7, 7);
    monsters[0] = Monster(0, 0);
    monsters[1] = Monster(size - 1, size - 1);
    monsters[2] = Monster(size - 1, 0);
    monsters[3] = Monster(0, size - 1);
}
bool Game::hasFinished() {
    return !finished;
}
int Game::getScore() {
    return score;
}
void Game::cls() {
    for(int i = 0; i < 50; i++) {
        std::cout << "\n";
    }
}
void Game::fill() {
    for(int i = 0; i < size; i++) {
        for(int j = 0; j < size; j++) {
            area[i][j] = defaultSign;
        }
    }
    for(int i = 0; i < 4; i++) {
        area[monsters[i].getX( )][monsters[i].getY( )] = monsters[i].getSign( );
    }
    area[player.getX( )][player.getY( )] = player.getSign( );
}
void Game::display() {
    for(int i = 0; i < size; i++) {
        for(int j = 0; j < size; j++) {
            std::cout << area[i][j];
        }
        std::cout << "\n";
    }
}
void Game::round() {
    cls( );
    fill( );
    display( );
    playerMove( );
    for(int i = 0; i < 4; i++) {
        monsters[i].moveTowards(player);
    }
    score++;
}
void Game::playerMove() {
    bool moved = false;
    while(!moved) {
        char c = getch( );
        if(c == 'w' || c == 'W') {
            player.move(player.getX( ), player.getY( ) + 1);
            moved = true;
        }
        if(c == 'a' || c == 'A') {
            player.move(player.getX( ) - 1, player.getY( ));
            moved = true;
        }
        if(c == 's' || c == 'S') {
            player.move(player.getX( ), player.getY( ) - 1);
            moved = true;
        }
        if(c == 'd' || c == 'D') {
            player.move(player.getX( ) + 1, player.getY( ));
            moved = true;
        }
    }
}

```

entity.h

```
#ifndef ENTITY
#define ENTITY

class Entity {
    protected:
        int x, y;
        char sign;
    public:
        Entity(int xPos, int yPos);
        int getX();
        int getY();
        void move(int xPos, int yPos);
        char getSign();
};

class Player : public Entity {
    private:
        char sign = 'P';
    public:
        Player(int xPos, int yPos);
};

class Monster : public Entity {
    private:
        char sign = 'M';
    public:
        Monster(int xPos, int yPos);
        void moveTowards(Entity p);
};

#endif

```

entity.cpp

```
#include <entity.h>

Entity::Entity(int xPos, int yPos) {
    x = xPos;
    y = yPos;
    sign = '*';
}
void Entity::move(int xPos, int yPos) {
    x = xPos;
    y = yPos;
}
int Entity::getX() {
    return x;
}
int Entity::getY() {
    return y;
}
char Entity::getSign() {
    return sign;
}

Player::Player(int xPos, int yPos)
        : Entity(xPos, yPos) {
}

Monster::Monster(int xPos, int yPos)
        : Entity(xPos, yPos) {
}
void Monster::moveTowards(Entity p) {
    int moveArea[2] = {x, y};
    if(x > p.getX( )) moveArea[0]--;
    if(x < p.getX( )) moveArea[0]++;
    if(y > p.getY( )) moveArea[1]--;
    if(y < p.getY( )) moveArea[1]++;
    move(moveArea[0], moveArea[1]);
}

```

Please, help!