Exemplo n.º 1
0
        private void Ignite(IAtlas atlas, ITilesetTable tilesetTable)
        {
            var fireplaceBurning = new FireplaceBurning(tilesetTable, Position);

            atlas.ReplaceWith(ThisGameActorPosition(LayerType.OnGroundInteractable), fireplaceBurning);
            atlas.RegisterToAutoupdate(fireplaceBurning);
        }
Exemplo n.º 2
0
 public void ObjectDetected(IGameObject gameObject, IAtlas atlas)
 {
     if (SomeoneOnTile)
     {
         return;
     }
     NextUpdateAfter = 60;
     atlas.RegisterToAutoupdate(this);
 }
Exemplo n.º 3
0
 public void ObjectDetected(IGameObject gameObject, IAtlas atlas)
 {
     if (m_wasActive)
     {
         m_isActive = true;
         return;
     }
     m_isActive      = true;
     NextUpdateAfter = 1;
     atlas.RegisterToAutoupdate(this);
 }
Exemplo n.º 4
0
        public void ObjectDetected(IGameObject gameObject, IAtlas atlas, ITilesetTable tilesetTable)
        {
            var avatar = gameObject as IAvatar;
            if (avatar != null)
            {
                avatar.Energy -= ENERGY_FOR_STEP_ON_TRAP;
            }

            var forwardMovable = gameObject as IForwardMovable;
            if (forwardMovable != null)
            {
                forwardMovable.ForwardSpeed = 0;
            }

            gameObject.Position = Vector2.Floor(gameObject.Position) + Vector2.One/2;

            var trapDischarged = new TrapDischarged(tilesetTable, Position);
            atlas.RegisterToAutoupdate(trapDischarged);
            atlas.ReplaceWith(new GameActorPosition(this, new Vector2(Position), LayerType.OnGroundInteractable),
                trapDischarged);
        }
Exemplo n.º 5
0
        public void ObjectDetected(IGameObject gameObject, IAtlas atlas, ITilesetTable tilesetTable)
        {
            var avatar = gameObject as IAvatar;

            if (avatar != null)
            {
                avatar.Energy -= ENERGY_FOR_STEP_ON_TRAP;
            }

            var forwardMovable = gameObject as IForwardMovable;

            if (forwardMovable != null)
            {
                forwardMovable.ForwardSpeed = 0;
            }

            gameObject.Position = Vector2.Floor(gameObject.Position) + Vector2.One / 2;

            var trapDischarged = new TrapDischarged(tilesetTable, Position);

            atlas.RegisterToAutoupdate(trapDischarged);
            atlas.ReplaceWith(new GameActorPosition(this, new Vector2(Position), LayerType.OnGroundInteractable),
                              trapDischarged);
        }
Exemplo n.º 6
0
 public void ObjectDetected(IGameObject gameObject, IAtlas atlas, ITilesetTable tilesetTable)
 {
     if(SomeoneOnTile) return;
     NextUpdateAfter = 60;
     atlas.RegisterToAutoupdate(this);
 }
Exemplo n.º 7
0
 private void Ignite(IAtlas atlas, ITilesetTable tilesetTable)
 {
     var fireplaceBurning = new FireplaceBurning(tilesetTable, Position);
     atlas.ReplaceWith(ThisGameActorPosition(LayerType.OnGroundInteractable), fireplaceBurning);
     atlas.RegisterToAutoupdate(fireplaceBurning);
 }