Skip to content

Instantly share code, notes, and snippets.

@franksands
Created December 9, 2015 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save franksands/c6e4056438570c306d9c to your computer and use it in GitHub Desktop.
Save franksands/c6e4056438570c306d9c to your computer and use it in GitHub Desktop.
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