private void ResetGame() { GameObjects.Clear(); _borderBlocks = new EnemyObject[17]; for (int i = 0; i < 17; ++i) { _borderBlocks[i] = new EnemyObject(this, Textures["_borderBlocksGraphics"], 62 * i + 800, _copter, _speed); GameObjects.Add(_borderBlocks[i]); } _midBlock = new MidEnemyObject(this, Textures["_midBlocksGraphics"], 850, _copter, _speed); _midBlock2 = new MidEnemyObject(this, Textures["_midBlocksGraphics"], 850 + 600, _copter, _speed); GameObjects.Add(_midBlock); GameObjects.Add(_midBlock2); _copter = new CopterObject(this, Textures["_copterGraphics"], _borderBlocks, _midBlock, _midBlock2); GameObjects.Add(_copter); _smoke = new SmokeObject[20]; for (int i = 0; i < 20; ++i) { _smoke[i] = new SmokeObject(this, Textures["_smokeGraphics"], _copter, -195 + i * 10, _speed); GameObjects.Add(_smoke[i]); } _wings = new WingsObject(this, Textures["_wingsGraphics1"], _copter); GameObjects.Add(_wings); }
//------------------------------------------------------------------------------------- // Class constructors internal CopterObject(Game1 game, Texture2D texture, EnemyObject[] enemies, MidEnemyObject mid1, MidEnemyObject mid2) : base(game, Vector2.Zero, texture) { // Store a strongly-typed reference to the game _game = game; rivals = enemies; mid_1 = mid1; mid_2 = mid2; // Set a random position PositionX = 340; PositionY = 200; Height = texture.Height; Width = texture.Width; // Set the origin Origin = new Vector2(texture.Width, texture.Height) / 2; isHit = 0; _xadd = -3; Angle = 0.04F; }