public void Init ( Vector2 position, Rectangle final_position, Vector2 rand_position, float angle, HealthBar roothp, ref EnergyStorage ES ) { _position = position; _final_position = final_position; _ES = ES; _isvalid = true; _arrived = false; _counter = 0; _pause = 0; _damage_counter = 0; _angle = angle; _killed = false; _healthbar = new Tuple <HealthBar, HealthBar> ( roothp.Clone() as HealthBar, roothp.Clone() as HealthBar ); _healthbar.Item1.SetColor(Color.Red); _healthbar.Item2.SetColor(Color.Black); //calculate direction Vector2 diff = Vector2.Subtract(position, rand_position); _direction = Vector2.Normalize(diff); }
public EnergyStorageManager(Texture2D texture, int w, int h, HealthBar healtroot) { _rootenergystorage = new EnergyStorage(texture, w, h); _energy_storages = new List <EnergyStorage>(); _hproot = healtroot; }