-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
37 lines (33 loc) · 1.19 KB
/
Main.java
File metadata and controls
37 lines (33 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package Hero;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
Hero Hero1=new Hero ("Ashe","Okçu",540,50);
Hero Hero2=new Hero ("Ryze","Büyücü",600,35);
while(Hero1.can>0&&Hero2.can>0){
System.out.println("-Seçim Yap-");
System.out.println("1-"+Hero1.isim+" Saldırı Yapsın");
System.out.println("2-"+Hero2.isim+" Saldırı Yapsın");
System.out.println("3-Durum Göster");
System.out.println(" ");
int secim=sc.nextInt();
switch(secim){
case 1:
Hero1.saldir();
Hero2.hasarAl(Hero1.hasar);
break;
case 2:
Hero2.saldir();
Hero1.hasarAl(Hero2.hasar);
break;
case 3:
Hero1.durumGoster();
Hero2.durumGoster();
break;
default:System.out.println("Geçersiz seçim yaptınız tekrar deneyiniz");
System.out.println(" ");
}
} System.out.println("Savaş Sona Erdi... Kazanan-->"+(Hero1.can>0 ? Hero1.isim :Hero2.isim));
}
}