Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Project Source Files/Actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
#include <cmath>
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) {
Expand Down Expand Up @@ -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 did a great job" << endl;
// score of points
man.points = man.points + (MushroomPoints * numMushroom);
// Show score of points
cout << "Congratulations :) score of points : " << man.points << endl;

}