Ejemplo n.º 1
0
 public WaterCtrl(float worldDistance, float velHorizontal)
 {
     this.worldDistance = worldDistance;
     waters = new List<Water>();
     activeWater = new Water(new Vector2(0, yDisp));
     waters.Add(activeWater);
 }
Ejemplo n.º 2
0
 public void update(float currentDistance)
 {
     for (int i = 0; i < waters.Count - 1; i++)
     {
         if (waters.ElementAt(i).Position.X + waters.ElementAt(i).Size.X < currentDistance)
         {
             waters.RemoveAt(i);
         }
     }
     if (activeWater.Position.X < currentDistance)
     {
         activeWater = new Water(new Vector2(activeWater.Position.X + activeWater.Size.X, yDisp));
         waters.Add(activeWater);
     }
 }