Example #1
0
        protected override void Initialize()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);
            _basicDrawer = new BasicDrawer(_spriteBatch);
            _imagesStore = new ImagesStore();

            base.Initialize();
        }
 public CollectableGameObject(GameModel game, Point position, string name, string description, Bitmap sprite, Action action) : base(game, position)
 {
     IsCollectable = true;
     this.sprite   = sprite;
     Description   = description;
     Name          = name;
     Action        = action;
     Drawer        = new BasicDrawer(sprite, CollectImage);
 }
Example #3
0
 public BasicEnemy(GameModel game, Point position) : base(game, position)
 {
     Attack            = new Attack(new[] { new Size(1, 0), new Size(0, 1), new Size(-1, 0), new Size(0, -1) }, AttackType.Physical, 50, 2, false);
     movePossibilities = new[] { new Size(1, 0), new Size(0, 1), new Size(-1, 0), new Size(0, -1), new Size(0, 0) };
     Drawer            = new BasicDrawer(Sprite, CollectImage);
     Scheduler         = new Scheduler();
     Name        = "Skully";
     Description = "A lonely creepy skeleton";
 }
Example #4
0
        public Stone(GameModel game, int x, int y) : base(game, x, y)
        {
            IsSeeThrough = false;
            var variationRandomizer = Utils.GetRandomInt();

            Sprite = variationRandomizer > 75 ? variations[1] : variations[0];
            Drawer = new BasicDrawer(
                Sprite,
                CollectImage);
        }
Example #5
0
        public Hiro(GameModel game, Point position) : base(game, position, 100, null)
        {
            Drawer      = new BasicDrawer(Sprite, CollectImage, Color.Blue);
            Name        = "Hiro";
            Description = "Calm Archer. All attack are Physical";
            var pattern = new[] { new Size(-1, -1), new Size(0, 0), new Size(1, -1), new Size(1, 1), new Size(-1, 1) };

            EAttack       = new Attack(pattern, AttackType.Physical, 15, 6, true, 2);
            pattern       = new[] { new Size(0, 0) };
            QAttack       = new Attack(pattern, AttackType.Physical, 30, 7, true, 3);
            rangeOfVision = 9;
        }
Example #6
0
        public Kaba(GameModel game, Point position) : base(game, position, 150, null)
        {
            Drawer = new BasicDrawer(
                Sprite,
                CollectImage,
                Color.Red
                );
            Name        = "Kaba";
            Description = "Serious Knight. All attacks are Physical";
            var pattern = new[] { new Size(1, -1), new Size(1, 0), new Size(1, 1) };

            EAttack = new Attack(pattern, AttackType.Physical, 20, 2, false, 2);
            pattern = new[] { new Size(1, 0), new Size(2, 0) };
            QAttack = new Attack(pattern, AttackType.Physical, 28, 2, false, 2);
        }
Example #7
0
        protected virtual Bitmap CollectImage(BasicDrawer drawer)
        {
            var rotate = Direction switch
            {
                Direction.Left => RotateFlipType.Rotate90FlipNone,
                Direction.Right => RotateFlipType.Rotate90FlipX,
                Direction.Up => RotateFlipType.RotateNoneFlipY,
                _ => RotateFlipType.RotateNoneFlipNone,
            };
            var image = new Bitmap(drawer.Sprite);

            image.RotateFlip(rotate);
            using (var g = Graphics.FromImage(image))
                g.FillRectangle(Brushes.Green, 2, image.Height - 5, (float)((image.Width - 4) * (Health / initialHealth)), 4);
            return(image);
        }
Example #8
0
        public Naru(GameModel game, Point position) : base(game, position, 80, null)
        {
            Name        = "Naru";
            Description = "Careless Assasin. Can do Physical and Poison damage";
            Drawer      = new BasicDrawer(
                Sprite,
                CollectImage,
                Color.Pink
                );
            var pattern = new[] { new Size(-1, -1), new Size(-1, 1),
                                  new Size(1, -1), new Size(1, 1) };

            QAttack = new Attack(pattern, AttackType.Physical, 20, 3, false, 3);
            pattern = new[] { new Size(1, -1), new Size(1, 1) };
            EAttack = new Attack(pattern, AttackType.Poison, 25, 3, false, 2);
        }
Example #9
0
        public Hana(GameModel game, Point position) : base(game, position, 80, null)
        {
            Name        = "Hana";
            Description = "Quick tempered Mage. Does Fire and Ice damage";
            Drawer      = new BasicDrawer(
                Sprite,
                CollectImage,
                Color.BlueViolet
                );
            var pattern = new[] { new Size(1, -1), new Size(1, 0), new Size(1, 1),
                                  new Size(2, -2), new Size(2, -1), new Size(2, 0), new Size(2, 1), new Size(2, 2) };

            QAttack = new Attack(pattern, AttackType.Fire, 15, 1, false, 3);
            pattern = new[] { new Size(-1, 0),
                              new Size(0, -1), new Size(0, 0), new Size(0, 1),
                              new Size(1, 0) };
            EAttack = new Attack(pattern, AttackType.Ice, 25, 5, true, 2);
        }
 private Bitmap CollectImage(BasicDrawer drawer) => new Bitmap(drawer.Sprite);
Example #11
0
 public Exit(GameModel game, Point position) : base(game, position)
 {
     Drawer  = new BasicDrawer(Sprite, CollectImage);
     IsRigid = true;
 }
Example #12
0
 private Bitmap CollectImage(BasicDrawer drawer) => Sprite;