public ColonyShip(Game1 game, World world, float ratio, string texturePath, Player player) : base(game, world, texturePath) { _texture = Content.Load<Texture2D>(texturePath); _ratio = ratio; this.player = player; }
protected override void LoadContent() { _spriteBatch = new SpriteBatch(GraphicsDevice); _bitmapFont = Content.Load<BitmapFont>("Fonts/montserrat-32"); _bitmapFont2 = Content.Load<BitmapFont>("Fonts/enigma-42"); _background = new Sprite(Content.Load<Texture2D>("Miscellaneous/Deep-Space-4K-Wallpaper")); _Missile = new Sprite(Content.Load<Texture2D>("Player/Missile")){ Scale = new Vector2(0.3f) }; _player = new Player(game, _world, _ratio, 50f,new Vector2(40f, 10f), "Player/avion_0", "Player/avion_1", "Player/avion_2", "Player/avion_3", "Player/Missile_0", "Miscellaneous/CircleParticle"); //load textures and _player _border = new Border( _world); _camera.LookAt(_player.Position * _ratio); //_colonyShip = new ColonyShip(game, _world, _ratio, "Passive/ColonyShip",_player); //_colonyShip.CreateColonyShip(400, new Vector2(40f, 36f)); _planet = new Planet(game, _world, _ratio, 1000f, new Vector2(40f,36f), "Passive/planet_palma", "Passive/planet_palma4",_player); _invaders = new Invader(game, _world, _ratio, "Enemy/EnemyShip", "Enemy/MissileEnemy_0", "Miscellaneous/CircleParticle", _planet.planetBreakableBody); //_invaders.CreateInvader(300, new Vector2(30f,40f) + _planet.Position, angle: MathHelper.ToRadians(240)); _invaders.CreateInvader(300, new Vector2(80f * (float)Math.Cos(MathHelper.ToRadians(0 + 90)), -80f * (float)Math.Sin(MathHelper.ToRadians(0 + 90))) + _planet.Position, angle: MathHelper.PiOver2); _invaders.CreateInvader(300, new Vector2(80f * (float)Math.Cos(MathHelper.ToRadians(120 + 90)), -80f * (float)Math.Sin(MathHelper.ToRadians(120 + 90))) + _planet.Position, angle: MathHelper.ToRadians(-30)); _invaders.CreateInvader(300, new Vector2(80f * (float)Math.Cos(MathHelper.ToRadians(-120 + 90)), -80f * (float)Math.Sin(MathHelper.ToRadians(-120 + 90))) + _planet.Position, angle: MathHelper.ToRadians(220));//Something's wrong with this. System.Diagnostics.Debug.WriteLine(new Vector2(80f * (float)Math.Cos(MathHelper.ToRadians(-120 + 90)), -80f * (float)Math.Sin(MathHelper.ToRadians(-120 + 90))) + _planet.Position + "position invader"); _invaders.Practice = false; _mother = new InvaderMother(game, _world, _ratio, "Enemy/EnemyMotherShip", "Enemy/MissileMotherShip", "Miscellaneous / CircleParticle", _player.playerBreakableBody); }