0% found this document useful (0 votes)
27 views1 page

Domingo, Ralph Christian D. MAWP307 (JAVA)

The document describes a Java program that simulates a monster battle game. The program initializes variables like player health, monster health, damage values. It generates a random monster from an array and displays the battle. The player can choose to attack, which damages the monster. The while loop continues the battle until either the player or monster health reaches 0.

Uploaded by

Mark Velasquez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views1 page

Domingo, Ralph Christian D. MAWP307 (JAVA)

The document describes a Java program that simulates a monster battle game. The program initializes variables like player health, monster health, damage values. It generates a random monster from an array and displays the battle. The player can choose to attack, which damages the monster. The while loop continues the battle until either the player or monster health reaches 0.

Uploaded by

Mark Velasquez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Domingo, Ralph Christian D.

MAWP307

(JAVA)

import java.util.Random;
import java.util.Scanner;
public class ayawkosapanget{
public static void main (String[]args)

Scanner in = new Scanner(System.in);


Random rand= new Random();
String[] monster=(MAWP);

int EnemyHealth=1000;
int enemyAttackDamage=75;

int ayokosapanget=1000;
int attackDamage=150;
boolean running=true;
System.out.println(Welcome to a monster world);

Game:

while(running){
System.out.println(S T A R T>);
int MAWPHealth=rand.nextInt(EnemyHealth);
String enemy=monster[rand.next.int(monster.length)]
System.out.println(\t# + enemy +has appeared #\n)
while(MAWPHealth > 0 )

System.out.println(\tPlayer life points is: + ayokosapanget);


System.out.println(\t + enemy + s life points: + EnemyHealth);
System.out.println(\n\twhat would you like to do now?);
System.out.println(\tAttack*);

You might also like