How can I make this game work? I am clueless... I am a beginner and I am expected to create a game. The teacher is crazy!
The game is suppose to do this:
Krazy Kats!!
Your are to write a basic console game with the following premises:
You are a well renown Krazy Kat hunter sent into a town crawling with Krazy Kats!! These Kats wander through town attacking their victims with Eyes of Submission and Purrs of Doom. Once a human has been subdued they steal their Tuna Of Health!! You the hunter can put on Reflective Glasses or Earmuffs of Happiness to stop the Kats attacks. You also have the Kat Kapture system that safely bags and muffles the Kats.
The game mechanics work like this:
The Town
The town is a minimum of a 15x15 playable grid.
The grid at it's most basic has no obstacles just like a flat playing field.
You need to find characters from the ASCII character set to represent the hunter and the cats.
EXTRA CREDIT:
Place "houses" or other objects as obstacles in the grid.
Make the game at night, so the human only sees the 3 squares around him in all directions with his Torch of Discovery, cats can see in the dark so they find it funny he has a torch.
The "Stupid" Krazy Kats:
These cats wander around random purring or staring at random times
They really have no brain left having consumed too much bad tuna
The "Smarter" Krazy Kats:
These cats see the hunter and actively hunt him down. They seriously want his tuna!!
They will attack as soon as they get in range
They are smart however so they sometimes act like "Stupid" Krazy Kats to fool the hunter
The Kat Attacks:
Eyes of Submission - this attack only works if the cat is right next to the Hunter. it has a 60% chance of succeeding against the hunter. When the attack succeeds the Human loses a Tuna Can of Health.
Purrs of Doom - this attack is valid from two squares away and has an 80% chance of hitting the hunter. When this attack hits the hunter is stunned and can't take an action for one turn.
The Human:
The human has five cans of Tuna of Health. Once they have all been stolen the human falls under the spell of the Kats for the rest of his/her life
The Human Defense and Attacks:
Reflective Glasses - when deployed this reduces the chance of the Kats Eyes of Submission attack succeeding by half (or 30%)
Earmuffs of Happiness - when deployed this reduces the chance of the Kats purr of doom attack succeeding by half (or 40%)
Kat Kapture - When deploying the Kapture system the Hunter has a 75% chance of hitting the cat, and a 1% chance of capturing her/himself (you ever see a cat move?!? those suckers are fast and tricky!!
Once a Kat is captured there is a 10% chance that the Kat has an unopened can of Tuna of Health. NOTE: the range of the capture system is 1.
Movement and turns:
Each cat and hunter gets two actions per turn
The hunter and Kats can move in any of the surrounding directions and squares Up, down, left, right, diagonally too. Movement consumes one action per square
Any attack by the hunter or Kat takes one action.
The hunter and the Kat may not occupy the same square.
That's the game basics. I'll be posting a couple of videos to help with the design of this game. Please note that some of the code I'll be showing will be windows specific. If I find any mac/linux comparable code I'll include that too.
Additionally
Extra credit
Any additional skills for the cat and hunter (if and only if you have successfully implemented the base game.
The use of direct keyboard input vs a menu
Sound
Anything cool
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
struct Hunter{
int r;
int c;
int tuna;
Hunter(){
r = rand() % 8 + 1;
c = rand() % 18 + 1;
tuna = 5;
}
};
const int COL = 20;
void initializedBoard(char [][COL], int);
void displayBoard(char [][COL], int);
void youGotToMoveIt(char [][COL], int);
bool moveHunter(Hunter);
int main()
{
const int ROW = 20;
Hunter aHunter;
cout << aHunter.r << endl;
cout << aHunter.c << endl;
cout << aHunter.tuna << endl;
char board [ROW][COL];
initializedBoard(board, ROW);
displayBoard(board, ROW);
for(int i = 0; i < 5; i ++){
for(int x = 0; x < 1000000000; i++);
system("cls");
youGotToMoveIt(board, ROW);
displayBoard(board, ROW);
}
return 0;
}
void initializedBoard(char theBoard[][COL], int R){
for(int r = 0; r < R; r++){
for(int c = 0; c < COL; c++){
if(r == 0 || r == R-1){
theBoard[r][c]=205;
}else if(c == 0 || c == COL - 1){
theBoard[r][c]=186;
}else{
theBoard[r][c]=177;
}
}
}
theBoard[0][0] = 201;
theBoard[R-1][0] = 200;
theBoard[0][COL - 1] = 187;
theBoard[R-1][COL - 1] = 188;
}
void displayBoard(char theBoard[][COL], int R){
for (int r = 0; r < R; r++){
for(int c = 0; c < COL; c++){
cout << theBoard[r][c];
}
cout << endl;
}
}
void youGotToMoveIt(char theBoard[][COL], int R){
static int hunterX = 3;
static int hunterY = 3;
char hunter = 233;
theBoard[hunterY - 1][hunterX - 1] = 177;
theBoard[hunterY][hunterX] = hunter;
hunterX++;
hunterY++;
}
|