Ok, I added in another class to keep track of tile steps (sounds useless doesnt it ?:P) Anyways, when I tried to add it in, it gave me a weird error...
Code:
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
C:\MazeOfPain.cpp:
Error E2176 C:\KeeperClass.h 3: Too many types in declaration
*** 1 errors in Compile ***
It seems my compiler always gives me a new error thats totaly weird -,-.
Ok, the weird thing is, I have only declared threee classes. Keeper, Enemy, WeakWall.
The codes for each (Starting from WeakWall and ending with Enemy.)
Code:
#include <windows.h>
#include <iostream>
#include <string.h>
#include <conio.h>
#include <fstream>
using namespace std;
class WeakWall {
private:
SHORT Strength;
SHORT SteppedOn;
SHORT x;
SHORT y;
public:
WeakWall() {Strength=1; SteppedOn=0; x=0; y=0;}
WeakWall(SHORT str, SHORT Step, SHORT x_pos, SHORT y_pos) {Strength=str; SteppedOn=Step; x=x_pos; y=y_pos;}
SHORT GetX() {return x;}
SHORT GetY() {return y;}
SHORT GetStr() {return Strength;}
SHORT GetWStatus() {return SteppedOn;}
void Reset() {Strength=1; SteppedOn=0; x=0; y=0;}
}
Code:
#include "WeakWall.h"
class Keeper {
private:
SHORT zzx[5];
public:
Keeper() {zzx[0] = 0; zzx[1] = 0; zzx[2] = 0; zzx[3] = 0; zzx[4] = 0;}
Keeper(SHORT z, SHORT zz, SHORT zzz, SHORT zzzz, SHORT b) {zzx[0] = z; zzx[1] = zz; zzx[2] = zzz; zzx[3] = zzzz; zzx[4] = b;}
void Check(SHORT x) {zzx[x] = 1;}
void Uncheck(SHORT x) {zzx[x] = 0;}
void UncheckAll() {zzx[0] = 0; zzx[1] = 0; zzx[2] = 0; zzx[3] = 0; zzx[4] = 0;}
SHORT IsChecked(SHORT x);
};
SHORT Keeper::IsChecked(SHORT x) {
if(zzx[x] == 1)
return 1;
return 0;
}
Code:
#include "KeeperClass.h"
#define Enemy1 '@'
#define Enemy2 '&'
#define Enemy3 '$'
#define Enemy4 '%'
#define No 10 //Movement Definitions.
#define Ea 15
#define So 20
#define We 25
HANDLE hOt = GetStdHandle(STD_OUTPUT_HANDLE);
HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE);
class Enemy {
private:
char Ent;
int ex_pos;
int ey_pos;
int tag;
int mproc;
SHORT alive;
public:
Enemy() {Ent=0;ex_pos=0;ey_pos=0;tag=0;mproc=0;alive=0;}
Enemy(char t, int ex, int ey, int etag, int moving, SHORT live) {t=Ent;ex=ex_pos;ey=ey_pos;etag=tag;moving=mproc;live=alive;}
char GetType() {return Ent;}
int GetX() {return ex_pos;}
int GetY() {return ey_pos;}
int GetTag() {return tag;}
int GetMovement() {return mproc;} //40
SHORT IsAlive() {return alive;}
void SetType(char c) {Ent=c;}
void SetX(int x) {ex_pos=x;}
void SetY(int y) {ey_pos=y;}
void SetTag(int Tag) {tag=Tag;}
void SetMovement(int Move) {mproc=Move;}
void SetLive(int live) {alive=live;}
};
My compiler gives me no other errors (thankfully -,-) but It just seems to not like that I declared three classes. Though I dont know why it would mind that as I'm sure some people declare many more.
So, what is this error? Wish it was more discriptive -,-.
[Edit]
To avoid two posts, is it possible to create an array based on an int? IE:
Or is their some way I can fool my compiler by using a define? #define x; ?