Exemple #1
0
 protected void AddEnemy()
 {
     Texture2D EnemyTexture = Content.Load<Texture2D>("Enemy");
     Pawn Enemy = new Pawn(EnemyTexture, new Rectangle(0, 0, EnemyTexture.Width, EnemyTexture.Height), Color.SlateGray);
     Enemy.Position = new Vector2(100, 100);
     //Enemy.ToggleDebug(bDebug);
     Enemy.SetController(null);
     WorldActors.Add(Enemy);
 }
Exemple #2
0
 public virtual void SetActor(Pawn aActor)
 {
     pActor = aActor;
 }
Exemple #3
0
 public Controller(Pawn aActor)
 {
     pActor = aActor;
 }
Exemple #4
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);

            //Debug Font
            DebugFont = Content.Load<SpriteFont>("Debug Font");

            // TODO: use this.Content to load your game content here
            //Player
            Texture2D PlayerTexture = Content.Load<Texture2D>("Player");
            pPlayer = new Pawn(PlayerTexture, new Rectangle(0, 0, PlayerTexture.Width, PlayerTexture.Height), Color.SlateGray);
            pPlayer.Position = new Vector2(graphics.GraphicsDevice.Viewport.Width / 2, graphics.GraphicsDevice.Viewport.Height / 2);
            //pPlayer.ToggleDebug(bDebug);
            pPlayer.Sensor = new WallSensor(ref WorldActors, pPlayer, DebugFont);
            WorldActors.Add(pPlayer);

            if (bDebug)
            {
                AM = new ActorMover(ref WorldActors, DebugFont);
                IsMouseVisible = true;
            }
        }
 public AIController(ref Pawn aActor)
     : base(aActor)
 {
 }