Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- char move;
- bool quit = false;
- int phealth;
- int ophealth;
- cout << "===========================================" << endl;
- cout << "Welcome to the Street Fighter Tutorial Game" << endl;
- cout << "Attack the opponent until the healbar is 0!" << endl;
- cout << "===========================================" << endl;
- cout << " " << endl;
- phealth = 100;
- ophealth = 100;
- while (!quit) {
- cout << "Player Health: " << phealth << " ===== VS ===== Opponent Health: " << ophealth << endl;
- cout << " " << endl;
- cout << "Chose one of the following moves:" << endl;
- cout << "(1) Hadouken: 10 HP" << endl;
- cout << "(2) Shoryuken: 15 HP" << endl;
- cout << "(3) Hurrican Kick: 20 HP" << endl;
- cin >> move;
- if (move == '1') {
- cout << " " << endl;
- cout << "You did a HADOUKEN attack! -(10HP)" << endl;
- ophealth = (ophealth - 10);
- }
- else if (move == '2') {
- cout << "You did a SHORYUKEN attack! -(15HP)" << endl;
- ophealth = (ophealth - 15);
- }
- else if (move == '3') {
- cout << "You did a HURRICAN KICK attack! -(20HP)" << endl;
- ophealth = (ophealth - 20);
- }
- else if ((move != '1') || (move != '2' || (move != '3')) {
- cout << "Please enter a valid number!" << endl;
- }
- else if (ophealth < 20) {
- cout << "u win" << endl;
- quit = true;
- }
- else if (phealth <= 20) {
- cout << "u lose" << endl;
- quit = true;
- }
- phealth = (phealth - 20);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement