1
The Hydlaa Plaza / Re: So, what's new?
« on: June 29, 2006, 03:47:24 pm »
Nice! If my internet still had some life in it, I would download it right now!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Originally posted by Efflixi Aduro
State university > Random College
Originally posted by Cha0s
buddha: you don\'t use Pages? Pages has turned out very nicely. I used to use open office, but the speed issue really got me. So now I use Pages which gets a big :tup: from me.
Class A(){
char a;
public:
char get_a(){return a;}
void set_a(char x){a = x;}
};
Class B(){
char b;
public:
char get_b(){return b;}
void set_b(char x){a=x;}
};
int main(){
A objA;
B objB;
objA.set_a(\'x\');
objB.set_b(objA.get_a());
cout << objB.get_b();
return 0;
}
//Game Engine
#include
#include
using namespace std;
class Game {
char board[200][200];
int boardLength;
int boardHight;
int xPosition;
int yPosition;
int xSpawn;
int ySpawn;
int xMax;
int yMax;
int xMin;
int yMin;
int moveNum;
char moveL;
char moveR;
char moveU;
char moveD;
char aux1;
char aux2;
char aux3;
char aux4;
char playerSymbol;
public:
//Get private values
char get_moveL(){ return moveL;}
char get_moveR(){ return moveR;}
char get_moveU(){ return moveU;}
char get_moveD(){ return moveD;}
char get_aux1(){ return aux1;}
char get_aux2(){ return aux2;}
char get_aux3(){ return aux3;}
char get_aux4(){ return aux4;}
int get_xPosition(){ return xPosition;}
int get_yPosition(){ return yPosition;}
int get_moveNum(){ return moveNum;}
char get_playerSymbol(){ return playerSymbol;}
//Set Controls;
void set_moveL(char x){moveL = x;}
void set_moveR(char x){moveR = x;}
void set_moveU(char x){moveU = x;}
void set_moveD(char x){moveD = x;}
void set_aux1(char x){aux1 = x;}
void set_aux2(char x){aux2 = x;}
void set_aux3(char x){aux3 = x;}
void set_aux4(char x){aux4 = x;}
//Set board parameters
void set_boardSize(int x=0, int y=0){
boardLength = x;
boardHight = y;
}
//Set how far palyer can move
void set_boundries(int xl=boardLength, int yl=boardHight,
int xs=0, int ys=0){
xMax = xl;
yMax = yl;
xMin = xs;
yMin = ys;
}
//Set player spawn position
void set_spawn(int x=0, int y=0){
xSpawn = x;
ySpawn = y;
}
//Set player symbol
void set_playerSymbol(char p){playerSymbol = p}
void set_playerSymbol(int p){playerSymbol = p}
//Set number of moves.
void set_moveNum(int num){moveNum = num;}
/*Spawns barriers.
void spawnBarriers(){
int x;
int y;
for(int i=0; i<10; i++){
x = (rand()%9);
y = (rand()%9);
board[y][x] = \'o\';
}
}
*/
//Create a \"clean\" board.
void makeBoard(){
for(int i=0; i for(int x=0; x board[i][x] = \' \';
}
}
}
//Shows the board.
void showBoard(){
for(int i=0; i
for(int i=boardHight; i>(-1); i--){
cout << \"\\n|\";
for(int x=0; x cout << board[i][x];
}
cout << \"|\";
}
cout << \"\\n\";
for(int i=0; i }
//Resets Position.
void resetPosition(){
xPosition = xSpawn;
yPosition = ySpawn;
}
//Fills a sqare;
void fillPosition(){
board[yPosition][xPosition] = playerSymbol;
}
/*Checks for barriers
bool detectBarrier(char d){
if(d==moveL){
if(board[yPosition][xPosition-1]==\'o\') return true;
}
else if(d==moveR){
if(board[yPosition][xPosition+1]==\'o\') return true;
}
else if(d==moveU){
if(board[yPosition+1][xPosition]==\'o\') return true;
}
else if(d==moveD){
if(board[yPosition-1][xPosition]==\'o\') return true;
}
else return false;
}
*/
//Moves a character in a direction.
void movePosition(char direction){
if(direction == moveL){
if(xPosition == xMin){
return;
}
board[yPosition][xPosition] = \' \';
xPosition--;
moveNum++;
}
else if(direction == moveR){
if(xPosition == xMax){
return;
}
board[yPosition][xPosition] = \' \';
xPosition++;
moveNum++;
}
else if(direction == moveU){
if(yPosition == yMax){
return;
}
board[yPosition][xPosition] = \' \';
yPosition++;
moveNum++;
}
else if(direction == moveD){
if(yPosition == yMin){
return;
}
board[yPosition][xPosition] = \' \';
yPosition--;
moveNum++;
}
else cout << \"INVALID ARGUMENT\";
}
//TO BE CONTINUED.
};
void clear(){
system(\"cls\");
}
int main()
{
}