// Constructor for EnemyManager. public EnemyManager(Texture2D texture, Rectangle initialFrame, int frameCount, PlayerManager playerSprite, Rectangle screenBounds, SoundEffect firingSound) { this.texture = texture; this.initialFrame = initialFrame; this.frameCount = frameCount; this.playerManager = playerSprite; this.firingSound = firingSound; EnemyShotManager = new ShotManager(texture, new Rectangle(0, 494, 21, 21), 3, 9, 250f, screenBounds); SetUpWaypoints(); }
// PlayerManager's Constructor; Specifies what is needed to create an object using this class. public PlayerManager(Texture2D texture, int currentFrame, int spriteWidth, int spriteHeight, Rectangle screenBounds, SoundEffect firingSound) { // Update internal variables to the one's supplied by the constructor. this.playerSprite = texture; this.currentFrame = currentFrame; this.spriteWidth = spriteWidth; this.spriteHeight = spriteHeight; this.screenBounds = screenBounds; this.firingSound = firingSound; // Create a ShotManager for the player. PlayerShotManager = new ShotManager(texture, new Rectangle(0, 490, 3, 3), 5, 3, 650f, screenBounds); // Create the arms for the player. PlayerArms = new Arms(texture, position + armsOffset, new Rectangle(0, 142, 162, 51), 6); }