public CollisionManager(List <ISprite> sprites, Rectangle bounds, SoundManager soundManager, BubbleManager bubbleManager) { this.bubbleManager = bubbleManager; this.soundManager = soundManager; this.sprites = sprites; this.bounds = bounds; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { //this.Window.AllowUserResizing = true; // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); soundManager = new SoundManager(Content); soundManager.Play(Sound.Background); bubbleManager = new BubbleManager(Content, graphics.GraphicsDevice.Viewport.Bounds, 15); var windowWidth = graphics.GraphicsDevice.Viewport.Width; var windowHeight = graphics.GraphicsDevice.Viewport.Height; background = Content.Load <Texture2D>(@"images\background"); var playerImage = Content.Load <Texture2D>(@"images\birdsheet"); playerBall = new Player(playerImage, new Vector2(windowWidth / 2, windowHeight - playerImage.Height - 10), graphics.GraphicsDevice.Viewport.Bounds, 0, 10, 2, 2, 14); //bubbleManager.MakeBubble(Color.Yellow); //bubbleManager.MakeBubble(Color.White); //bubbleManager.MakeBubble(Color.Black); //bubbleManager.MakeBubble(Color.Brown); var sprites = new List <ISprite>(); sprites.Add(playerBall); sprites.AddRange(bubbleManager.Bubbles); collisionManager = new CollisionManager(sprites, graphics.GraphicsDevice.Viewport.Bounds, soundManager, bubbleManager); }
public CollisionManager(List<ISprite> sprites, Rectangle bounds, SoundManager soundManager, BubbleManager bubbleManager) { this.bubbleManager = bubbleManager; this.soundManager = soundManager; this.sprites = sprites; this.bounds = bounds; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { //this.Window.AllowUserResizing = true; // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); soundManager = new SoundManager(Content); soundManager.Play(Sound.Background); bubbleManager = new BubbleManager(Content, graphics.GraphicsDevice.Viewport.Bounds, 15); var windowWidth = graphics.GraphicsDevice.Viewport.Width; var windowHeight = graphics.GraphicsDevice.Viewport.Height; background = Content.Load<Texture2D>(@"images\background"); var playerImage = Content.Load<Texture2D>(@"images\birdsheet"); playerBall = new Player(playerImage, new Vector2(windowWidth / 2, windowHeight - playerImage.Height - 10), graphics.GraphicsDevice.Viewport.Bounds, 0, 10, 2,2,14); //bubbleManager.MakeBubble(Color.Yellow); //bubbleManager.MakeBubble(Color.White); //bubbleManager.MakeBubble(Color.Black); //bubbleManager.MakeBubble(Color.Brown); var sprites = new List<ISprite>(); sprites.Add(playerBall); sprites.AddRange(bubbleManager.Bubbles); collisionManager = new CollisionManager(sprites, graphics.GraphicsDevice.Viewport.Bounds, soundManager,bubbleManager); }