Created
December 9, 2015 00:46
-
-
Save franksands/c6e4056438570c306d9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LivingThing { | |
public String name; | |
public int health; | |
public int magicPoints; | |
public String attack; | |
public LivingThing(String name, int health, int magicPoints, String attack) { | |
this.name = name; | |
this.health = health; | |
this.magicPoints = magicPoints; | |
this.attack = attack; | |
} | |
} | |
LivingThing hero = new LivingThing("Elsa", 50, 80, "Axe"); | |
LivingThing[] monsters = new LivingThing[3]; | |
monsters[0] = new LivingThing("Goblin", 20, 0, "Dagger"); | |
monsters[1] = new LivingThing("Dragon", 300, 200, "Fireball"); | |
monsters[2] = new LivingThing("Orc", 20, 0, "Sword"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment