Can you help me, I am new to C++. I am getting error "error C2065: 'level': undeclared identifier in game.cpp. Please help.
I have attached the project if you need it.
Level.h
#ifndef LEVEL_H
#define LEVEL_H
class Level
{
public:
Level(DrawEngine *de, int width = 30, int height = 20);
~Level();
}
#endif
Level.cpp
#include "level.h"
#include <stdlib.h>
Level::Level(DrawEngine *de, int w, int h)
{
drawArea = de;
width = w;
height = h;
player = 0;
// create memory for our level
//char **
level = new char *[width];
for(int x = 0; x < width; x++)
level[x] = new char[height];
// create the level
createLevel();
drawArea->setMap(level);
}
Level::~Level()
{
//delete the memory for our level
for(int x = 0; x < width; x++)
delete [] level[x];
delete [] level;
}
Game.cpp
#include "game.h"
#include <conio.h>
#include <Windows.h>
#include <iostream>
using namespace std;
//this is going to give us about 30 frames per second
#define GAME_SPEED = 1000 / 30;
bool Game::run(void)
{
level = new Level(&drawArea, 30, 20);
//more code below, not relevent
Thanks
http://giggig.co.uk/evilMonkeys.rar - not allowd to attach .rar files?

New Topic/Question
Reply



MultiQuote







|