├── Bear.java ├── Cave.java ├── Game.java ├── Player.java ├── BattleLoc.java ├── SafeHouse.java ├── ToolStore.java ├── Zombie.java ├── Vampire.java ├── River.java ├── Forest.java ├── Main.java ├── README.md ├── NormalLoc.java ├── .gitignore ├── Location.java ├── Obstacle.java └── Inventory.java /Bear.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmcetindag/AdventureGame/HEAD/Bear.java -------------------------------------------------------------------------------- /Cave.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmcetindag/AdventureGame/HEAD/Cave.java -------------------------------------------------------------------------------- /Game.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmcetindag/AdventureGame/HEAD/Game.java -------------------------------------------------------------------------------- /Player.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmcetindag/AdventureGame/HEAD/Player.java -------------------------------------------------------------------------------- /BattleLoc.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmcetindag/AdventureGame/HEAD/BattleLoc.java -------------------------------------------------------------------------------- /SafeHouse.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmcetindag/AdventureGame/HEAD/SafeHouse.java -------------------------------------------------------------------------------- /ToolStore.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmcetindag/AdventureGame/HEAD/ToolStore.java -------------------------------------------------------------------------------- /Zombie.java: -------------------------------------------------------------------------------- 1 | 2 | public class Zombie extends Obstacle { 3 | 4 | public Zombie() { 5 | super("Zombi", 3, 10, 4, 3); 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Vampire.java: -------------------------------------------------------------------------------- 1 | 2 | public class Vampire extends Obstacle { 3 | 4 | public Vampire() { 5 | super("Vampir", 4, 14, 7, 3); 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /River.java: -------------------------------------------------------------------------------- 1 | 2 | public class River extends BattleLoc{ 3 | 4 | River(Player player) { 5 | super(player, "River", new Bear(),"Water"); 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Forest.java: -------------------------------------------------------------------------------- 1 | 2 | public class Forest extends BattleLoc{ 3 | 4 | Forest(Player player) { 5 | super(player, "Orman", new Vampire(),"Firewood"); 6 | 7 | } 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Main { 4 | 5 | public static void main(String[] args) { 6 | Game game = new Game(); 7 | game.login(); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AdventureGame 2 | Java ile Nesne Yönelimli Programlamayı daha iyi kavramak ve anlamak için geliştirdiğimiz Macera Oyunu 3 | 4 | Youtube Kanalı : https://www.youtube.com/kodlamavakti 5 | 6 | Eğitim Videosu : https://www.youtube.com/watch?v=fuwzYPwIkY4 7 | -------------------------------------------------------------------------------- /NormalLoc.java: -------------------------------------------------------------------------------- 1 | 2 | public abstract class NormalLoc extends Location{ 3 | 4 | NormalLoc(Player player,String name) { 5 | super(player); 6 | this.name = name; 7 | } 8 | 9 | 10 | public boolean getLocation() { 11 | return true; 12 | } 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | -------------------------------------------------------------------------------- /Location.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public abstract class Location { 4 | protected Player player; 5 | protected String name; 6 | Scanner scan = new Scanner(System.in); 7 | 8 | Location(Player player){ 9 | this.player = player; 10 | } 11 | 12 | public abstract boolean getLocation(); 13 | 14 | public Player getPlayer() { 15 | return player; 16 | } 17 | 18 | public void setPlayer(Player player) { 19 | this.player = player; 20 | } 21 | 22 | public String getName() { 23 | return name; 24 | } 25 | 26 | public void setName(String name) { 27 | this.name = name; 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Obstacle.java: -------------------------------------------------------------------------------- 1 | import java.util.Random; 2 | public class Obstacle { 3 | private String name; 4 | private int damage, award, health, maxNumber; 5 | 6 | public Obstacle(String name, int damage, int health, int award, int maxNumber) { 7 | this.name = name; 8 | this.damage = damage; 9 | this.award = award; 10 | this.health = health; 11 | this.maxNumber = maxNumber; 12 | } 13 | 14 | public int count() { 15 | Random r = new Random(); 16 | return r.nextInt(this.maxNumber) + 1; 17 | } 18 | 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | public void setName(String name) { 24 | this.name = name; 25 | } 26 | 27 | public int getDamage() { 28 | return damage; 29 | } 30 | 31 | public void setDamage(int damage) { 32 | this.damage = damage; 33 | } 34 | 35 | public int getAward() { 36 | return award; 37 | } 38 | 39 | public void setAward(int award) { 40 | this.award = award; 41 | } 42 | 43 | public int getHealth() { 44 | return health; 45 | } 46 | 47 | public void setHealth(int health) { 48 | this.health = health; 49 | } 50 | 51 | public int getMaxNumber() { 52 | return maxNumber; 53 | } 54 | 55 | public void setMaxNumber(int maxNumber) { 56 | this.maxNumber = maxNumber; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /Inventory.java: -------------------------------------------------------------------------------- 1 | 2 | public class Inventory { 3 | private boolean water,food,firewood; 4 | private String wName,aName; 5 | private int damage,armor; 6 | 7 | Inventory(){ 8 | this.water = false; 9 | this.food = false; 10 | this.firewood = false; 11 | this.damage = 0; 12 | this.armor = 0; 13 | this.wName = null; 14 | this.aName = null; 15 | } 16 | 17 | public boolean isWater() { 18 | return water; 19 | } 20 | 21 | public void setWater(boolean water) { 22 | this.water = water; 23 | } 24 | 25 | public boolean isFood() { 26 | return food; 27 | } 28 | 29 | public void setFood(boolean food) { 30 | this.food = food; 31 | } 32 | 33 | public boolean isFirewood() { 34 | return firewood; 35 | } 36 | 37 | public void setFirewood(boolean firewood) { 38 | this.firewood = firewood; 39 | } 40 | 41 | public String getwName() { 42 | return wName; 43 | } 44 | 45 | public void setwName(String wName) { 46 | this.wName = wName; 47 | } 48 | 49 | public String getaName() { 50 | return aName; 51 | } 52 | 53 | public void setaName(String aName) { 54 | this.aName = aName; 55 | } 56 | 57 | public int getDamage() { 58 | return damage; 59 | } 60 | 61 | public void setDamage(int damage) { 62 | this.damage = damage; 63 | } 64 | 65 | public int getArmor() { 66 | return armor; 67 | } 68 | 69 | public void setArmor(int armor) { 70 | this.armor = armor; 71 | } 72 | 73 | 74 | } 75 | --------------------------------------------------------------------------------