Esempio n. 1
0
        public Enemy(ContentManager cM, Character target)
        {
            AssetName = "Enemy";
            Scale = 1.0f;
            base.LoadContent(cM, AssetName); //takes care of sSpriteTexture + sSpriteSize IMPORTANT: AFTER SCALE DECLARATION
            Position = RandomSpawn();
            Speed = 100;
            Origin = new Vector2((Size.Width / 2), (Size.Height / 2));
            Layer = 0.3f;
            Rotation = FindRotationDirection(this, target);
               // Direction = new Vector2((target.Position.X - Position.X), (target.Position.Y - Position.Y));
               // if (Direction != Vector2.Zero) Direction.Normalize();

            //CurrentState = State.Moving;
        }
Esempio n. 2
0
 /// <summary>
 /// LoadContent will be called once per game and is the place to load
 /// all of your content.
 /// </summary>
 protected override void LoadContent()
 {
     // Create a new SpriteBatch, which can be used to draw textures.
     spriteBatch = new SpriteBatch(GraphicsDevice);
     turret1 = new Turret(this.Content, new Vector2(150, 200));
     turret2 = new Turret(this.Content, new Vector2(400, 400));
     turret3 = new Turret(this.Content, new Vector2(650, 150));
     // TODO: use this.Content to load your game content here
     mainCharacter = new Character(this.Content);
     cursor = new Cursor(this.Content);
 }