From bc9f0a3a1a632ca1a7cfc83a435c7703f7936e93 Mon Sep 17 00:00:00 2001 From: CMP15group2 Date: Sun, 5 Apr 2015 05:51:24 -0700 Subject: [PATCH 1/4] "Fire Feature" --- Project Source Files/Actions.h | 10 ++++++++-- Project Source Files/main.cpp | 16 +++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Project Source Files/Actions.h b/Project Source Files/Actions.h index 262ceff..5369aff 100644 --- a/Project Source Files/Actions.h +++ b/Project Source Files/Actions.h @@ -2,10 +2,16 @@ #include using namespace std; -void Run (supermario &man) +void Run (supermario &man,Enemy &Enemy) {cout << "Run fn is called for the supermario at ( " << man.pos.x << " , " << man.pos.y << " )\n"; // constraints not handled man.pos.x += 1; man.pos.y += 1; -} \ No newline at end of file + + //kill + man.points -=1; + Enemy.power -=1; + man.health -=1; + +} diff --git a/Project Source Files/main.cpp b/Project Source Files/main.cpp index b4f45f9..9837e03 100644 --- a/Project Source Files/main.cpp +++ b/Project Source Files/main.cpp @@ -1,10 +1,12 @@ #include "Actions.h" +#include "Kill.h" int main () { - supermario player1; - while(1) - { - Run(player1); - } - return 0; -} \ No newline at end of file +supermario player1; +Enemy E1; +while(1) +{ +Run (player1,E1); +} +return 0; +} From 107085cd1a2ac8a94eb7ea56a2bcf980b64dc079 Mon Sep 17 00:00:00 2001 From: CMP15group2 Date: Sun, 5 Apr 2015 09:20:40 -0700 Subject: [PATCH 2/4] Fire Feature --- Project Source Files/Actions.h | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/Project Source Files/Actions.h b/Project Source Files/Actions.h index 5369aff..6dd6797 100644 --- a/Project Source Files/Actions.h +++ b/Project Source Files/Actions.h @@ -2,16 +2,36 @@ #include using namespace std; -void Run (supermario &man,Enemy &Enemy) +void Run (supermario &man) {cout << "Run fn is called for the supermario at ( " << man.pos.x << " , " << man.pos.y << " )\n"; // constraints not handled man.pos.x += 1; man.pos.y += 1; - //kill - man.points -=1; - Enemy.power -=1; - man.health -=1; +} +// to kill the enemy (affect the power of the enemy, and the points of the supermario ) +// to kill supermario (affect the health of the supermario) +void fire (supermario &man,Enemy &Enemy1,holes &h) +{ + + // statues of supermario ==3 supermario is fire on the enemy + if (man.status==3) + { + man.points +=10; //decrese power of enemy 10 + Enemy1.power -=10; //increse points of the supermario 10 point + if (Enemy1.power==0) + Enemy1.status=0; //Enemy dead + cout << "Enemy Kill at ( " << Enemy1.pos.x << " , " << Enemy1.pos.y << " )\n"; + } + //// statues of enemy ==3 enemy is fire on the supermario + if (Enemy1.status ==3) + { + man.health -=10; //decrese power supermario 10 point + if(man.health==0) + man.status=0; //supermario dead + cout << "supermario Kill at ( " << man.pos.x << " , " << man.pos.y << " )\n"; + } + } From 555bcc06cc895e57a964537d7da00f6db8624cbc Mon Sep 17 00:00:00 2001 From: CMP15group2 Date: Sun, 5 Apr 2015 09:34:41 -0700 Subject: [PATCH 3/4] Fire Feature --- Project Source Files/Actions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project Source Files/Actions.h b/Project Source Files/Actions.h index 6dd6797..ee5b927 100644 --- a/Project Source Files/Actions.h +++ b/Project Source Files/Actions.h @@ -12,7 +12,7 @@ void Run (supermario &man) } // to kill the enemy (affect the power of the enemy, and the points of the supermario ) // to kill supermario (affect the health of the supermario) -void fire (supermario &man,Enemy &Enemy1,holes &h) +void fire (supermario &man,Enemy &Enemy1) { // statues of supermario ==3 supermario is fire on the enemy From f29915c3b38daa186e2293a5f6859d0bf6a8fa2f Mon Sep 17 00:00:00 2001 From: CMP15group2 Date: Sun, 5 Apr 2015 09:35:50 -0700 Subject: [PATCH 4/4] Fire Feature --- Project Source Files/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Project Source Files/main.cpp b/Project Source Files/main.cpp index 9837e03..5d86503 100644 --- a/Project Source Files/main.cpp +++ b/Project Source Files/main.cpp @@ -3,10 +3,9 @@ int main () { supermario player1; -Enemy E1; while(1) { -Run (player1,E1); +Run (player1); } return 0; }