Example #1
0
 public Boolean doesHit(Character target)
 {
     //check target's distance, check your attack range. see if intersects; if so return true
     return false;
 }
Example #2
0
 //Way you access CombatController
 //CombatController combat = CombatController.Instance;
 ////Then you could call the setMainCharacter function defined above
 //combat.setMainCharacter(player);
 public void confirmedHit(Character attacker, Character defender)
 {
     defender.takeDamage(damageFormula(attacker,defender));
 }
Example #3
0
 public int damageFormula(Character attacker, Character target)
 {
     int damage=attacker.strength - target.defense;
     if (damage < 1) damage = 1;
     return damage;
 }
Example #4
0
 public static void hit(Character attacker, Character defender)
 {
 }