Skip to content
Permalink
Browse files
Linked battlescene to enemies stats
Improved enemy spawn function
  • Loading branch information
mateussa committed Feb 24, 2018
1 parent 949650d commit 4aad6a1d502bf6005252de1bdfb9b45aede21633
Show file tree
Hide file tree
Showing 9 changed files with 224 additions and 112 deletions.
@@ -16,4 +16,5 @@ obj/
!libmysql-505/bin/libmysql.dll


# End of https://www.gitignore.io/api/codeblocks
# End of https://www.gitignore.io/api/codeblocks
Maze Raider.cscope_file_list
@@ -5,7 +5,7 @@
#include <array>

#define attackAnimSpeed 10
#define defencehealAnimSpeed 150
#define defenceHealAnimSpeed 150

using namespace std;

@@ -27,20 +27,20 @@ class BattleScene
bool enemyJustAttacked;

// Set of player actions
void PlayerAttack(int num, int color, int power, int speed = attackAnimSpeed);
void PlayerDefend(int num, int color, int speed = defencehealAnimSpeed);
void PlayerHeal(int num, int color, int power, int speed = defencehealAnimSpeed);
void PlayerAttack(int num, int color, int power);
void PlayerDefend(int num, int color);
void PlayerHeal(int num, int color, int power);

// Set of enemy actions
void EnemyAttack(int num, int color, int power, int speed = attackAnimSpeed);
void EnemyDefend(int num, int color, int speed = defencehealAnimSpeed);
void EnemyHeal(int num, int color, int power, int speed = defencehealAnimSpeed);
void EnemyAttack();
void EnemyDefend();
void EnemyHeal();

//TEMP
int playerHealth = 100;
int playerMaxHealth = 100;
int enemyHealth = 100;
int enemyMaxHealth = 100;
int enemyHealth;
int enemyMaxHealth;
protected:

private:
@@ -62,11 +62,11 @@ class BattleScene
void UpdateBattleInfo(pair<string, int> lineToAdd);

// Play attack animation
void PlayAttack(int num, int color, int speed);
void PlayAttack(int num, int color);
// Play defend animation
void PlayDefend(int num, int color, int speed);
void PlayDefend(int num, int color);
// Play heal animation
void PlayHeal(int num, int color, int speed);
void PlayHeal(int num, int color);

// Meshes
vector<vector<string>> enemyMesh = {{" ",
@@ -1,6 +1,5 @@
#ifndef ENEMY_H
#define ENEMY_H
#include "Maze.h"
#include <array>
#include <vector>
#include <cstdlib> //random generation
@@ -16,19 +15,41 @@ class Enemy
Enemy(Maze* m);

//functions
void moveEnemy(void);
void randomMoveEnemy();
// 0 = Up | 1 = Right | 1 = Down | 3 = Left
void moveEnemy(int direction);

// Enemy stats
int getHealth();
int getArmor();
int getPower();
int getHealPower();

// Animation types
int getAttackColour();
int getAttackType();
int getDefenceColour();
int getDefenceType();
int getHealColour();
int getHealType();


//variables
Maze* maze;
int xPosEnemy, yPosEnemy;
int xPos, yPos;


protected:

private:
// Moving variables
int eDirection, ranVal, ranDecision;

// Enemy stats
int health, armor, power, healPower;

// Animation types
int attackColour, attackType, defenceColour, defenceType, healColour, healType;
};

#endif // ENEMY_H
@@ -23,8 +23,8 @@
#define leftVertical (char)180
#define attackBottom (char)223
#define attackTop (char)220
#define heal (char)207
#define shield (char)245
#define healSymbol (char)207
#define shieldSymbol (char)245
#define cursorPosition(h, x, y) SetConsoleCursorPosition( h, { x, y } )
#define red SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12)
#define blue SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 9)
@@ -64,8 +64,8 @@
#define leftVertical "\u253c"
#define attackBottom "\u2580"
#define attackTop "\u2584"
#define heal "\u00a4"
#define shield "\u00a7"
#define healSymbol "\u00a4"
#define shieldSymbol "\u00a7"
#define cursorPosition(h, x, y) cout << "\033[" << y << ";" << x << "H"
#define red cout << "\033[1;31m"
#define blue cout << "\033[1;34m"

0 comments on commit 4aad6a1

Please sign in to comment.