//constructors public BossBase(Vector2 centerLocation, IBossBehavior bossBehavior, BulletPool bulletPool, GameTime gameTime) { this.centerLocation = centerLocation; this.bossBehavior = bossBehavior; BulletPool = bulletPool; GameTime = gameTime; }
public override void Initialize() { //engine camera = new Camera(new Vector3(0, 0, 300), -Vector3.UnitZ, Vector3.UnitY); GameTime = new GameTime(); bulletPool = new BulletPool(100, GameTime); //player player1 = new BodyDebug(new Vector2(0, -200), 4, 1, new Rectangle(-250, -300, 500, 600)); isAlive = true; //boss boss1 = new BossDebug(new Vector2(0, 200), new BossSimpleBehavior(), bulletPool, GameTime); boss1.BulletPool = bulletPool; //bullets testPattern = new SpiralPattern(new Vector2(0, 100), 1, -1, 1, 18000, 180, GameTime); testPattern2 = new SpiralPattern(new Vector2(100, 100), 3, 1, 1, 1000, 180, GameTime); testPattern3 = new SpiralPattern(new Vector2(-100, 100), 3, 23, 1, 1000, 180, GameTime); testPattern2.BulletPool = bulletPool; testPattern3.BulletPool = bulletPool; //patterns.Add(testPattern); patterns.Add(testPattern2); patterns.Add(testPattern3); //initializes key history keyHistory = new Dictionary<int, List<Key>>(); rewinding = false; }
//Constructor public BulletPool(int poolSize, GameTime gameTime) { PoolSize = poolSize; IsReverse = false; this.gameTime = gameTime; //allocates memory with reusable bullets for (int i = 0; i < PoolSize; i++) { bullets.Add(new BulletBase(Vector2.Zero, 1, new StandardBehavior(Vector2.Zero, Vector2.Zero, 0, 0), 0)); } }
//constructors public SpiralPattern(Vector2 origin, int framesPerBullet, float degreesPerBullet, float bulletSpeed, int numBullets, float startAngle, GameTime gameTime) { this.origin = origin; this.framesPerBullet = framesPerBullet; this.degreesPerBullet = degreesPerBullet; this.bulletSpeed = bulletSpeed; this.angle = startAngle; this.startAngle = startAngle; this.numBullets = numBullets; this.gameTime = gameTime; patternEntryFrame = gameTime.Frame; IsReverse = false; }
public BossDebug(Vector2 centerLocation, IBossBehavior bossBehavior, BulletPool bulletPool, GameTime gameTime) : base(centerLocation, bossBehavior, bulletPool, gameTime) { }