public Bubble MakeBubble(Color bubbleColor, Vector2? position = null, int speed = 0, int mass = 0)
        {
            if (Bubbles.Count >= MaxBubbles)
            return null;

              var image = content.Load<Texture2D>(@"images\bubble");
              var pos = (Vector2)(position ?? GetRandomPosition(image));
              speed = speed == 0 ? 50 : speed;
              mass = mass == 0 ? 1 : mass;

              var bubble = new Bubble(image, pos, bounds, speed, mass, bubbleColor);
              Bubbles.Add(bubble);
              return bubble;
        }
Exemple #2
0
        public Bubble MakeBubble(Color bubbleColor, Vector2?position = null, int speed = 0, int mass = 0)
        {
            if (Bubbles.Count >= MaxBubbles)
            {
                return(null);
            }

            var image = content.Load <Texture2D>(@"images\bubble");
            var pos   = (Vector2)(position ?? GetRandomPosition(image));

            speed = speed == 0 ? 50 : speed;
            mass  = mass == 0 ? 1 : mass;

            var bubble = new Bubble(image, pos, bounds, speed, mass, bubbleColor);

            Bubbles.Add(bubble);
            return(bubble);
        }
 public void RemoveCollidable(Bubble bubble)
 {
     sprites.Remove(bubble);
 }
 public void RemoveCollidable(Bubble bubble)
 {
     sprites.Remove(bubble);
 }
 public void Pop(Bubble bubble)
 {
     Bubbles.Remove(bubble);
 }
Exemple #6
0
 public void Pop(Bubble bubble)
 {
     Bubbles.Remove(bubble);
 }