示例#1
0
        public Peon(Engine game, PeonManager manager, Texture2D gfxPlaceholder, Vector2 position)
            : base(game)
        {
            this.game = game;
            this.tex  = new SpriteSheet(gfxPlaceholder, new Vector2(21, 20), 3.0f);
            this.glow = new SpriteSheet(Engine.ContentManager.Load <Texture2D>("glowPeon"), new Vector2(26, 30), 3);

            sfxWorshipping = Engine.ContentManager.Load <SoundEffect>("sound/bleep");

            boundingCircle    = new BoundingCircle(position, 10);
            comfortZone       = new BoundingCircle(position, 20);
            this.tex.Position = position;
            //opacity = 1.0f;
            //this.gfxPlaceholder.FrameCount = 3;

            favorTex        = Engine.ContentManager.Load <Texture2D>("favorBar");
            favorBorder     = Engine.ContentManager.Load <Texture2D>("favorBorder");
            this.tex.Origin = new Vector2(10, 10);
            glow.Origin     = new Vector2(13, 15);
            // add our peon to the manager which contains all peons
            manager.addPeon(this);
            vehicle          = new Vehicle();
            vehicle.Position = position;
            opacity          = 0.1f;
            //startFollowingPlayer(Engine.playerOne);
            startWandering();

            this.peonManager = manager;
        }