Exemple #1
0
        public Tile(TileType type, GridSheet sheet)
        {
            IsAnimating = false;
            GSheet      = sheet;

            switch (type)
            {
            case TileType.Grass:
                CurrentColumn = Rng.Noxt(3);
                CurrentRow    = 0;
                ID            = CurrentColumn;
                break;

            case TileType.Tree:
                break;

            case TileType.Stone:
                break;

            case TileType.Bush:
                break;

            case TileType.Water:
                break;
            }
        }
Exemple #2
0
        public Usable(UsableType type, GridSheet sheet)
        {
            this.type = type;
            GSheet    = sheet;

            switch (this.type)
            {
            case UsableType.HealthPot:
                Value = 10;
                break;

            case UsableType.ManaPot:
                Value  = 5;
                Column = 1;
                break;
            }

            Type = ItemType.Usable;
        }
Exemple #3
0
        public Enemy(GridSheet sheet, GraphicsDevice gd, Player player) : base(gd)
        {
            GSheet    = sheet;
            playerRef = player;

            AddAnimation(new int[] { 0, 1, 0, 2 }, 0, "walkdown");
            AddAnimation(new int[] { 0, 1, 0, 2 }, 1, "walkup");
            AddAnimation(new int[] { 0, 1, 0, 2 }, 2, "walkleft");
            AddAnimation(new int[] { 0, 1, 0, 2 }, 3, "walkright");

            Speed = 45f;

            SetHealth(10);
            SetDamage(1, 3);
            SetExp((int)Rng.NoxtDouble((Health / 2) * 0.8, (Health / 2) * 1.2));
            Console.WriteLine(MaxExp);
            KnockbackPower      = 2f;
            HealthBar.BarHeight = 2;
            HealthBar.BarWidth  = 16;
            HealthBar.distanceBetweenObjectY = -4;
        }
        public override void LoadContent()
        {
            base.LoadContent();
            if (content == null)
            {
                content = new ContentManager(ScreenManager.Game.Services, "Content");
            }

            playerSheet = content.Load <GridSheet>("SpriteSheets/playerSheet");
            swingSheet  = content.Load <GridSheet>("SpriteSheets/swingNew");
            goblinSheet = content.Load <GridSheet>("SpriteSheets/goblinSheet");
            skeleSheet  = content.Load <GridSheet>("SpriteSheets/skeleSheet");
            itemSheet   = content.Load <GridSheet>("SpriteSheets/itemSheet");
            tileSheet   = content.Load <GridSheet>("SpriteSheets/tileSheet");

            cam = new Camera();
            map = new Map();
            map.LoadMap(LoadType.Fill, 100, 100);

            player = new Player(playerSheet, swingSheet, ScreenManager.GraphicsDevice, cam)
            {
                Position = new Vector2((map.Width * 32) / 2, (map.Height * 32) / 2)
            };
            loManager  = new LivingObjectManager();
            popManager = new PopupManager();
            //loManager.AddEnemy(new Enemy(goblinSheet, ScreenManager.GraphicsDevice) { Position = new Vector2(400) });

            items.Add(new Usable(UsableType.HealthPot, itemSheet)
            {
                Vacuumable = true, Position = new Vector2(450)
            });
            items.Add(new Usable(UsableType.ManaPot, itemSheet)
            {
                Vacuumable = true, Position = new Vector2(200)
            });

            cam.Position = player.CenterBox;
            cam.Zoom     = 2.0f;
        }
Exemple #5
0
        public Player(GridSheet shet, GridSheet swing, GraphicsDevice grap, Camera camer) : base(grap)
        {
            IsPlayer        = true;
            IsDrawHealthBar = true;
            gd             = grap;
            cam            = camer;
            GSheet         = shet;
            KnockbackPower = 4f;

            Swing        = new SheetAnimation();
            Swing.GSheet = swing;
            Swing.AddAnimation(new int[] { 0, 2, 4, 6, 7, 7, 7, 7, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15 }, 0, "swing");
            Swing.AddAnimation(new int[] { 0 }, 0, "test");

            Swing.Size             = new Vector2(32, 96);
            Swing.Origin           = new Vector2(40, 48);
            Swing.frameLength      = 0.015;
            Swing.CurrentAnimation = Swing.Animations["swing"];

            AddAnimation(new int[] { 0, 1, 2, 3 }, 0, "walkdown");
            AddAnimation(new int[] { 0, 1, 2, 3 }, 1, "walkup");
            AddAnimation(new int[] { 0, 1, 2, 3 }, 2, "walkright");
            AddAnimation(new int[] { 0, 1, 2, 3 }, 3, "walkleft");

            Speed             = 150;
            AnimationDuration = 0.60;

            attackWidth  = 48;
            attackLength = 64;
            //attackOrigin = new Vector2(Size.X / 2, Size.Y);

            SetHealth(20);
            SetMana(10);
            SetDamage(2, 5);
            SetExp(10);
            inventory = new Inventory(gd);
        }
 /// <summary>
 /// Populate values from the base palette.
 /// </summary>
 /// <param name="common">Reference to common settings.</param>
 public void PopulateFromBase(KryptonPaletteCommon common)
 {
     // Populate only the designated styles
     GridList.PopulateFromBase(common, GridStyle.List);
     GridSheet.PopulateFromBase(common, GridStyle.Sheet);
 }
Exemple #7
0
        public Tile(int id, GridSheet sheet)
        {
            GSheet = sheet;
            switch (id)
            {
            case 0: break;

            case 1: break;

            case 2: break;

            case 3: break;

            case 4: break;

            case 5: break;

            case 6: break;

            case 7: break;

            case 8: break;

            case 9: break;

            case 10: break;

            case 11: break;

            case 12: break;

            case 13: break;

            case 14: break;

            case 15: break;

            case 16: break;

            case 17: break;

            case 18: break;

            case 19: break;

            case 20: break;

            case 21: break;

            case 22: break;

            case 23: break;

            case 24: break;

            case 25: break;

            case 26: break;

            case 27: break;

            case 28: break;

            case 29: break;

            case 30: break;

            default: break;
            }
        }