Skip to content
Open
Show file tree
Hide file tree
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
28 changes: 27 additions & 1 deletion Project Source Files/Actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,30 @@ void Run (supermario &man)
// constraints not handled
man.pos.x += 1;
man.pos.y += 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)
{

// 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";
}


}
15 changes: 8 additions & 7 deletions Project Source Files/main.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#include "Actions.h"
#include "Kill.h"
int main ()
{
supermario player1;
while(1)
{
Run(player1);
}
return 0;
}
supermario player1;
while(1)
{
Run (player1);
}
return 0;
}