Ejemplo n.º 1
0
		public LivingController(LivingEntity entity) {
			//Setup entity
			this.Entity = entity;
			this.Entity.Controller = this;
			this.Entity.Moving += OnMoving;
			this.Entity.FacingChanged += OnFacingChanged;

			//Setup default settings
			this.Queue = new Queue<Movement>();
			this.KeyboardInputEnabled = true;

			int xs = -((int) Entity.AbsolutePosition.X - (GameEngine.WIDTH >> 1));
			int ys = -((int) Entity.AbsolutePosition.Y - (GameEngine.HEIGHT >> 1));
		
			Entity.World.Camera.Location = new Vector2(xs, ys);
		}
Ejemplo n.º 2
0
        public LivingController(LivingEntity entity)
        {
            //Setup entity
            this.Entity                = entity;
            this.Entity.Controller     = this;
            this.Entity.Moving        += OnMoving;
            this.Entity.FacingChanged += OnFacingChanged;

            //Setup default settings
            this.Queue = new Queue <Movement>();
            this.KeyboardInputEnabled = true;

            int xs = -((int)Entity.AbsolutePosition.X - (GameEngine.WIDTH >> 1));
            int ys = -((int)Entity.AbsolutePosition.Y - (GameEngine.HEIGHT >> 1));

            Entity.World.Camera.Location = new Vector2(xs, ys);
        }