Beispiel #1
0
        public override void ResolveCollision(DoorCollisionResponse other)
        {
            // if door is bombable, switch sprite to bombed hole and change collision response to door collision repsonse.
            Door door = (Door)other.entity;

            if (door.doorType == Door.Type.BombWall)
            {
                switch (door.name)
                {
                case "up":
                    door.GetComponent <Sprite>().SetSprite(LevelMapSpriteFactory.Instance.CreateTopHole());
                    break;

                case "down":
                    door.GetComponent <Sprite>().SetSprite(LevelMapSpriteFactory.Instance.CreateDownHole());
                    break;

                case "left":
                    door.GetComponent <Sprite>().SetSprite(LevelMapSpriteFactory.Instance.CreateLeftHole());
                    break;

                case "right":
                    door.GetComponent <Sprite>().SetSprite(LevelMapSpriteFactory.Instance.CreateRightHole());
                    break;
                }
                door.doorType = Door.Type.Open;
            }
        }
        public override void ResolveCollision(DoorCollisionResponse other)
        {
            if (isProjectile)
            {
                Entity.Destroy(entity);
            }

            var transform = entity.GetComponent <Transform>();

            transform.position = transform.lastPosition;
        }
Beispiel #3
0
 public override void ResolveCollision(DoorCollisionResponse other)
 {
     // Just overriding
 }
 public override void ResolveCollision(DoorCollisionResponse other)
 {
     Entity.Destroy(entity);
 }