Exemplo n.º 1
0
 public ClusterBullet(CharacterSide side, fk_Vector position, fk_Vector velocity) : base(side, LifeMax, position,
                                                                                         velocity)
 {
     Model = new fk_Model()
     {
         Shape    = new fk_Block(2, 2, 2),
         Material = fk_Material.Red,
         BMode    = fk_BoundaryMode.CAPSULE,
         //BDraw = true,
         BLineColor = fk_Material.Green.Diffuse
     };
     Model.SetCapsule(new fk_Vector(0, 0, 0), new fk_Vector(0, 0, 0.01), 1);
 }
Exemplo n.º 2
0
 public NormalBullet(CharacterSide side, fk_Vector position, fk_Vector velocity, fk_Material material,
                     double scale = 1) : base(side, LifeMax, position,
                                              velocity)
 {
     Model = new fk_Model()
     {
         Shape    = new fk_Block(scale, scale, scale),
         Material = material,
         BMode    = fk_BoundaryMode.CAPSULE,
         //BDraw = true,
         BLineColor = fk_Material.Green.Diffuse
     };
     Model.SetCapsule(new fk_Vector(0, 0, 0), new fk_Vector(0, 0, 0.01), scale);
 }
Exemplo n.º 3
0
 public PierceBullet(CharacterSide side, fk_Vector position, fk_Vector velocity) : base(side, LifeMax, position,
                                                                                        velocity)
 {
     Model = new fk_Model()
     {
         Shape    = new fk_Block(1, 1, 1),
         Material = fk_Material.DimYellow,
         BMode    = fk_BoundaryMode.CAPSULE,
         //BDraw = true,
         BLineColor = fk_Material.Green.Diffuse
     };
     Model.SetCapsule(new fk_Vector(0, 0, 0), new fk_Vector(0, 0, 0.01), 1);
     Model.GlRotate(Position, fk_Axis.Y, FK.PI / 4.0);
 }
Exemplo n.º 4
0
        public void SetContent(Content content, CharacterSide side)
        {
            availableMovementTexture = content.DistanceOverlay;
            lockSprite = content.Lock;

            var animationFactory = content.GetAnimationFactory(side);

            animatedSprite[CharacterFacing.North] = new AnimatedSprite(animationFactory, content.GetSpriteTag(Colour, CharacterFacing.North));
            animatedSprite[CharacterFacing.North] = new AnimatedSprite(animationFactory, content.GetSpriteTag(Colour, CharacterFacing.North));
            animatedSprite[CharacterFacing.East]  = new AnimatedSprite(animationFactory, content.GetSpriteTag(Colour, CharacterFacing.East));
            animatedSprite[CharacterFacing.South] = new AnimatedSprite(animationFactory, content.GetSpriteTag(Colour, CharacterFacing.South));
            animatedSprite[CharacterFacing.West]  = new AnimatedSprite(animationFactory, content.GetSpriteTag(Colour, CharacterFacing.West));

            fullHealthTexture  = content.FullHealthTexture;
            emptyHealthTexture = content.EmptyHealthTexture;
            initiativeTexture  = content.InitiativeTexture;
            blackTexture       = content.BlackTexture;
        }
Exemplo n.º 5
0
        protected BulletBase(CharacterSide side, int lifeMax, fk_Vector position, fk_Vector velocity) : base(side, lifeMax, position)
        {
            Velocity = velocity;

            switch (side)
            {
            case CharacterSide.Player:
                GameInfo.GetInstance().AddPlayerSide(this);
                break;

            case CharacterSide.Enemy:
                GameInfo.GetInstance().AddEnemySide(this);
                break;

            case CharacterSide.Other:
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(side), side, null);
            }
        }
Exemplo n.º 6
0
        private void PlaceCharacterOnMap(Character character, List <MapPoint> otherPlacements, CharacterSide side)
        {
            MapPoint characterPoint;
            var      deployment = side == CharacterSide.Spaghetti ? spaghettiDeployment : unicornDeployment;

            do
            {
                characterPoint = new MapPoint(
                    random.Next(new Range <int>(deployment.X, deployment.X + deployment.Width)),
                    random.Next(new Range <int>(deployment.Y, deployment.Y + deployment.Height))
                    );
            } while (otherPlacements.Contains(characterPoint));
            otherPlacements.Add(characterPoint);
            character.MapPosition = characterPoint;
            character.Facing      = characterPoint.Y < MapHelper.MapWidth / 2 ? CharacterFacing.South : CharacterFacing.North;
        }
Exemplo n.º 7
0
 private Texture2D GetIconForSide(CharacterSide side)
 {
     return(side == CharacterSide.Spaghetti ? spaghettiHatIcon : unicornHatIcon);
 }
Exemplo n.º 8
0
        private SpriteSheetAnimationFactory CreateAnimationFactory(ContentManager contentManager, CharacterSide side)
        {
            var sideString = side.ToString().ToLower();
            var texture    = contentManager.Load <Texture2D>($"sprites/{sideString}/sprites");
            var map        = contentManager.Load <Dictionary <string, Rectangle> >($"sprites/{sideString}/spritesMap");
            var atlas      = new TextureAtlas("character", texture, map);
            var factory    = new SpriteSheetAnimationFactory(atlas);

            var start = -1;

            factory.Add(GetSpriteTag(CharacterColour.Blue, CharacterFacing.East), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.Blue, CharacterFacing.North), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.Blue, CharacterFacing.South), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.Blue, CharacterFacing.West), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.Green, CharacterFacing.East), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.Green, CharacterFacing.North), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.Green, CharacterFacing.South), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.Green, CharacterFacing.West), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.None, CharacterFacing.East), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.None, CharacterFacing.North), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.None, CharacterFacing.South), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.None, CharacterFacing.West), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.Red, CharacterFacing.East), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.Red, CharacterFacing.North), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.Red, CharacterFacing.South), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.Red, CharacterFacing.West), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.White, CharacterFacing.East), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.White, CharacterFacing.North), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.White, CharacterFacing.South), new SpriteSheetAnimationData(Next6(ref start)));
            factory.Add(GetSpriteTag(CharacterColour.White, CharacterFacing.West), new SpriteSheetAnimationData(Next6(ref start)));

            return(factory);
        }
Exemplo n.º 9
0
 public SpriteSheetAnimationFactory GetAnimationFactory(CharacterSide side)
 {
     return(side == CharacterSide.Spaghetti ? spaghettiFactory : unicornFactory);
 }
Exemplo n.º 10
0
 public void SetWinnerSide(CharacterSide side)
 {
     Status = BattleStatus.Finished;
     WinnerParticipantId = Sides.SingleOrDefault(keyValuePair => keyValuePair.Value == side).Key;
 }