private void AddBunny() { mBunny = new Bunny(mTexture); mBunny.SpeedX = (float)random.NextDouble() * 5; mBunny.SpeedY = (float)random.NextDouble() * 5 - 2.5f; mBunny.ScaleX = mBunny.ScaleY = (float)random.NextDouble() + 0.3f; mBunny.Rotation = (float)random.NextDouble() * 30 - 15; AddChild(mBunny); mBunnies.Add(mBunny); }
private void RemoveBunny() { if (mBunnies.Count > 0) { mBunny = mBunnies[mBunnies.Count - 1]; mBunnies.RemoveAt(mBunnies.Count - 1); if (mBunny != null) { mBunny.Parent.RemoveChild(mBunny); } } }
private void RemoveBunny() { if (mBunnies.Count > 0){ mBunny = mBunnies[mBunnies.Count - 1]; mBunnies.RemoveAt(mBunnies.Count - 1); if (mBunny != null) { mBunny.Parent.RemoveChild(mBunny); } } }