From 9cfb221a7744fde0ed4fc0a97417a2314daca76f Mon Sep 17 00:00:00 2001 From: ahm92ed Date: Tue, 7 Apr 2015 00:29:03 +0300 Subject: [PATCH 1/3] Finshing Feature GetBonus --- Project Source Files/Actions.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Project Source Files/Actions.h b/Project Source Files/Actions.h index e730f32..f48e654 100644 --- a/Project Source Files/Actions.h +++ b/Project Source Files/Actions.h @@ -3,12 +3,14 @@ #include using namespace std; + 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; + } void Jump (supermario &man, const holes &hole) { @@ -39,3 +41,18 @@ void Jump (supermario &man, const holes &hole) { cout<<"\toof that was close, Supermario jumped over the hole\n"; } } + +// Feature GetBonus when eating a mushroom :) + +void GetBonus(supermario &man, int numMushroom) +{ + // The number of points of eating mushrooms ... Assume that each mushroom 100 points + int MushroomPoints = 100; + if (numMushroom > 0) + cout << "Wow Wow Wow >>> You've great job" << endl; + // score of points + man.points = man.points + (MushroomPoints * numMushroom); + // Show score of points + cout << "Congratulations :) score of points : " << man.points << endl; + +} \ No newline at end of file From cb96173f4c2c1dd2c81f48f96867bbde8191cf93 Mon Sep 17 00:00:00 2001 From: ahm92ed Date: Tue, 7 Apr 2015 00:50:40 +0300 Subject: [PATCH 2/3] Finshing Feature GetBonus update1 --- 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 f48e654..8f7d2ff 100644 --- a/Project Source Files/Actions.h +++ b/Project Source Files/Actions.h @@ -49,7 +49,7 @@ void GetBonus(supermario &man, int numMushroom) // The number of points of eating mushrooms ... Assume that each mushroom 100 points int MushroomPoints = 100; if (numMushroom > 0) - cout << "Wow Wow Wow >>> You've great job" << endl; + cout << "Wow Wow Wow >>> You did a great job" << endl; // score of points man.points = man.points + (MushroomPoints * numMushroom); // Show score of points From ef19530ed98edb56c8a0cd4e100be00f2aa9a6de Mon Sep 17 00:00:00 2001 From: Raneem_medhat Date: Wed, 8 Apr 2015 11:56:04 +0200 Subject: [PATCH 3/3] Fixing position comparison. --- Project Source Files/Actions.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Project Source Files/Actions.h b/Project Source Files/Actions.h index 116da48..c6ee57b 100644 --- a/Project Source Files/Actions.h +++ b/Project Source Files/Actions.h @@ -44,10 +44,15 @@ void CollectPoints (supermario &man, const Enemy &enemy) { //Make sure enemy is dead if (enemy.status==0) { //Must be standing at the points to collect them - if (enemy.pos==man.pos) + if (enemy.pos.x==man.pos.x) { - man.points++; - cout<