From fe85ebab77aa285570f3618289dc5d0c96e87a5e Mon Sep 17 00:00:00 2001 From: 16mbishop <16mbishop@hs15mathstu12.hiltoncsd.net> Date: Mon, 23 May 2016 10:27:13 -0400 Subject: [PATCH] just doing a test --- src/tanks/Living.java | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/tanks/Living.java b/src/tanks/Living.java index 9360df2..1e8359d 100644 --- a/src/tanks/Living.java +++ b/src/tanks/Living.java @@ -9,5 +9,41 @@ package tanks; public class Living extends RotationalElement { + public int health; + public boolean isAlive; + public Living() + { + health=0; + isAlive=true; + } + public void setHealth(int holdH) + { + health=holdH; + } + public void setAlive(boolean holdA) + { + isAlive=holdA; + } + public int getHealth() + { + return health; + } + public boolean getAlive() + { + return isAlive; + } + /* + when method is called,takes health away from living object, + if health is less than 0, is alive = false + + */ + public void takeDamage() + { + health-=10; + if(health<=0) + { + isAlive=false; + } + } }