diff --git a/Project Source Files/Actions.h b/Project Source Files/Actions.h index 262ceff..ee5b927 100644 --- a/Project Source Files/Actions.h +++ b/Project Source Files/Actions.h @@ -8,4 +8,30 @@ void Run (supermario &man) // constraints not handled man.pos.x += 1; man.pos.y += 1; -} \ No newline at end of file + +} +// 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"; + } + + +} diff --git a/Project Source Files/main.cpp b/Project Source Files/main.cpp index b4f45f9..5d86503 100644 --- a/Project Source Files/main.cpp +++ b/Project Source Files/main.cpp @@ -1,10 +1,11 @@ #include "Actions.h" +#include "Kill.h" int main () { - supermario player1; - while(1) - { - Run(player1); - } - return 0; -} \ No newline at end of file +supermario player1; +while(1) +{ +Run (player1); +} +return 0; +}