Time for action – the ExplosionManager class

  1. Add a new class called "ExplosionManager" to the Asteroid Belt Assault project.
  2. Add the standard using directives to the class file:
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Graphics;
  3. Add declarations to the ExplosionManager class:
    private Texture2D texture; private List<Rectangle> pieceRectangles = new List<Rectangle>(); private Rectangle pointRectangle; private int minPieceCount = 3; private int maxPieceCount = 6; private int minPointCount = 20; private int maxPointCount = 30; private int durationCount = 90; private float explosionMaxSpeed = 30f; private float pieceSpeedScale = 6f; private int pointSpeedMin = 15; private int pointSpeedMax = 30; private Color initialColor = new Color(1.0f, ...

Get XNA 4.0 Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.