Ejemplo n.º 1
0
 public void CreateDynamicPixel(Color c, float x, float y, float vX, float vY, int size)
 {
     if (!this.World.IsInside(new Vector2I((int)x, (int)y)))
     {
         Debug.LogError("ERROR: Attempted to create dynamic pixel out of bounds!");
     }
     else
     {
         //Debug.Log("Creating Dynamic Pixels");
         DynamicPixel newPixel = new DynamicPixel(this.World, c, x, y, vX, vY, size);              // creates pixel with color, position, velocity, and size info
         newPixel.pD = this;
         newPixel.Start();
         SpawnedPixels.Add(newPixel);        // track our new pixel with our list
         newPixel.stickiness = 1000;         // determine how slow a pixel must go to "stick" to City
         physics.Add(newPixel);              // Add to our physics
     }
 }
Ejemplo n.º 2
0
 public void DestroyDynamicPixel(DynamicPixel pixel)
 {
     physics.Remove(pixel);          // and physics
     SpawnedPixels.Remove(pixel);    // Remove it from our list7
 }