Example #1
0
        public MrSkeltal() : base(QuickGameScene.Current, Textures.SkeletonIdleTexture)
        {
            Position.SetWidth(8, GameEngine.AnchorOrigin.Left);
            Position.SetHeight(24, GameEngine.AnchorOrigin.Top);

            Animations.Add(AnimationKeys.Stand, this, TextureFlipBehavior.FlipWhenFacingLeft, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10).Texture = Textures.SkeletonIdleTexture;
            Animations.Add(AnimationKeys.Walk, this, TextureFlipBehavior.FlipWhenFacingLeft, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10).Texture  = Textures.SkeletonWalkTexture;
            Animations.AddRange(AnimationKeys.Attack, this, TextureFlipBehavior.FlipWhenFacingLeft, from: 0, to: 18, holdFrame: 4, holdFor: 8).Texture = Textures.SkeletonAttackTexture;


            var behavior = new EnemyBehavior <MrSkeltal>(this, EnemyBehaviorFlags.HasGravity | EnemyBehaviorFlags.FollowsPlayer);

            //behavior.SetReaction(ObstacleType.ShortWall, ObstacleReaction.ShortJump);
            //behavior.SetReaction(ObstacleType.TallWall, ObstacleReaction.TurnAround);

            behavior.AttackFlags = AttackFlags.AttackWhenClose | AttackFlags.StopWhileAttacking;

            DamageHandler = new EnemyDamageHandler <MrSkeltal>(5, this);

            behavior.Initialize();

            new AnimationController <MrSkeltal>(this, behavior.IsAttacking, Condition.False);

            var hitbox = new EnemyHitbox <MrSkeltal>(this,
                                                     new AnimationControlledHitbox(this, Animations, AnimationKeys.Attack, 7, 7));

            Scene.SolidLayer.CollidableObjects.Add(hitbox);


            //   new DebugRectangle(hitbox, Scene.SolidLayer);
        }
Example #2
0
        public Rogue() : base(QuickGameScene.Current, Textures.RogueTexture)
        {
            Position.SetWidth(8, GameEngine.AnchorOrigin.Left);
            Position.SetHeight(24, GameEngine.AnchorOrigin.Top);

            Animations.Add(AnimationKeys.Stand, this, TextureFlipBehavior.FlipWhenFacingLeft, 0, 1, 2).Texture              = Textures.RogueTexture;
            Animations.Add(AnimationKeys.Walk, this, TextureFlipBehavior.FlipWhenFacingLeft, 0, 1, 2, 3, 4, 5).Texture      = Textures.RogueRunTexture;
            Animations.AddRange(AnimationKeys.Attack, this, TextureFlipBehavior.FlipWhenFacingLeft, from: 0, to: 9).Texture = Textures.RogueAttackTexture;


            var behavior = new EnemyBehavior <Rogue>(this, EnemyBehaviorFlags.Moves | EnemyBehaviorFlags.HasGravity | EnemyBehaviorFlags.FollowsPlayer);

            behavior.Reactions.WalkingOffLedge = ObstacleReaction.TurnAround;
            behavior.Reactions.WalkingIntoWall = ObstacleReaction.TurnAround;

            behavior.AttackFlags = AttackFlags.ThrowFireball | AttackFlags.AttackPeriodically | AttackFlags.StopWhileAttacking;

            DamageHandler = new EnemyDamageHandler <Rogue>(5, this);

            behavior.Initialize();

            new AnimationController <Rogue>(this, behavior.IsAttacking, Condition.False);

            this.Direction = Direction.Left;
        }
Example #3
0
        public Slime() : base(QuickGameScene.Current, Textures.SlimeTexture)
        {
            Position.SetWidth(40, GameEngine.AnchorOrigin.Left);
            Position.SetHeight(24, GameEngine.AnchorOrigin.Top);

            Animations.Add(AnimationKeys.Stand, this, TextureFlipBehavior.FlipWhenFacingRight, 0, 0, 2, 2, 4, 4, 6, 6);

            new EnemyBehavior <Slime>(this, EnemyBehaviorFlags.HasGravity | EnemyBehaviorFlags.Moves);

            DamageHandler = new EnemyDamageHandler <Slime>(5, this);

            //new DebugRectangle(this);
        }
Example #4
0
        public Grapeman() : base(QuickGameScene.Current, Textures.GrapemanTexture)
        {
            Position.SetWidth(8, GameEngine.AnchorOrigin.Left);
            Position.SetHeight(24, GameEngine.AnchorOrigin.Top);

            Animations.Add(AnimationKeys.Stand, this, TextureFlipBehavior.FlipWhenFacingLeft, 0, 0, 0, 7, 7, 7);
            Animations.Add(AnimationKeys.Walk, this, TextureFlipBehavior.FlipWhenFacingLeft, 1, 2, 3, 4);
            Animations.Add(AnimationKeys.Jump, this, TextureFlipBehavior.FlipWhenFacingLeft, 5, 6);
            Animations.Add(AnimationKeys.Fall, this, TextureFlipBehavior.FlipWhenFacingLeft, 8);
            Animations.Add(AnimationKeys.Land, this, TextureFlipBehavior.FlipWhenFacingLeft, 7);
            Animations.Add(AnimationKeys.Attack, this, TextureFlipBehavior.FlipWhenFacingLeft, 10, 10, 10, 11, 11, 11, 12, 12, 12);

            new EnemyBehavior <Grapeman>(this, EnemyBehaviorFlags.None);

            DamageHandler = new EnemyDamageHandler <Grapeman>(5, this);
        }
Example #5
0
        public Snake() : base(QuickGameScene.Current, Textures.SnakeTexture)
        {
            Position.SetWidth(8, GameEngine.AnchorOrigin.Left);
            Position.SetHeight(16, GameEngine.AnchorOrigin.Top);

            Animations.Add(AnimationKeys.Walk, this, TextureFlipBehavior.FlipWhenFacingLeft, 0, 1, 2, 3);

            var behavior = new EnemyBehavior <Snake>(this, EnemyBehaviorFlags.MovesMore | EnemyBehaviorFlags.HasGravity);

            behavior.Reactions.WalkingOffLedge = ObstacleReaction.TurnAround;

            behavior.Initialize();


            DamageHandler = new EnemyDamageHandler <Snake>(2, this);
        }