Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Scenario implements Runnable {
- private String scenarioName;
- private int round = 0;
- public Scenario(int round, String scenarioName) {
- this.round = round;
- this.scenarioName = scenarioName;
- }
- Fighter Ryu = new Fighter("Ryu", 50);
- Fighter Ken = new Fighter("Ken", 50);
- @Override
- public void run() {
- System.out.println("Fighter " + Ryu.getFighterName() + " is ready to fight");
- System.out.println("Fighter " + Ken.getFighterName() + " is ready to fight");
- while (Ryu.isAlive() && Ken.isAlive()) {
- Ryu.punch();
- Ken.punch();
- Ryu.setHealth(Ryu.getHealth() - Ken.getStrength());
- Ken.setHealth(Ken.getHealth() - Ryu.getStrength());
- System.out.println(Ryu.getFighterName() + " strike with " + Ryu.getStrength() + " damage to " + (Ken.getFighterName()) + " Hit Points left " + Ken.getHealth());
- System.out.println(Ken.getFighterName() + " strike with " + Ken.getStrength() + " damage to " + (Ken.getFighterName()) + " Hit Points left " + Ryu.getHealth());
- }
- }
- public String getScenarioName() {
- return scenarioName;
- }
- public void setScenarioName(String scenarioName) {
- this.scenarioName = scenarioName;
- }
- public int getRound() {
- return round;
- }
- public void setRound(int round) {
- this.round = round;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement