Exemplo n.º 1
0
        public override void Load()
        {
            map = new TileMap("Dungeon_Room_2", world, penumbra, camera);

            var spriteSystem = (SpriteRenderer)world.GetFilter <SpriteRenderer>();

            if (spriteSystem != null)
            {
                SpriteRenderer.MapHeight = map.Height * map.TileHeight * Constants.SCALE;
            }

            camera.Zoom = 0.4f;

            var entities = BeyondAge.Assets.GetLuaData("entities");

            var p = world.Assemble("Player", 1280, 1280);

            p.Add <Animation>(new Animation(
                                  BeyondAge.Assets.GetTexture("character_sheet"),
                                  new Dictionary <string, List <Frame> >
            {
                { "front", new List <Frame> {
                      new Frame {
                          X = 0, Y = 0, Width = 16, Height = 32
                      },
                      new Frame {
                          X = 0, Y = 32, Width = 16, Height = 32
                      },
                      new Frame {
                          X = 0, Y = 0, Width = 16, Height = 32
                      },
                      new Frame {
                          X = 0, Y = 64, Width = 16, Height = 32
                      },
                  } },
                { "left", new List <Frame> {
                      new Frame {
                          X = 16, Y = 0, Width = 16, Height = 32
                      },
                      new Frame {
                          X = 16, Y = 32, Width = 16, Height = 32
                      },
                      new Frame {
                          X = 16, Y = 0, Width = 16, Height = 32
                      },
                      new Frame {
                          X = 16, Y = 64, Width = 16, Height = 32
                      },
                  } },
                { "back", new List <Frame> {
                      new Frame {
                          X = 32, Y = 0, Width = 16, Height = 32
                      },
                      new Frame {
                          X = 32, Y = 32, Width = 16, Height = 32
                      },
                      new Frame {
                          X = 32, Y = 0, Width = 16, Height = 32
                      },
                      new Frame {
                          X = 32, Y = 64, Width = 16, Height = 32
                      },
                  } },
                { "right", new List <Frame> {
                      new Frame {
                          X = 48, Y = 0, Width = 16, Height = 32
                      },
                      new Frame {
                          X = 48, Y = 32, Width = 16, Height = 32
                      },
                      new Frame {
                          X = 48, Y = 0, Width = 16, Height = 32
                      },
                      new Frame {
                          X = 48, Y = 64, Width = 16, Height = 32
                      },
                  } }
            }));
            p.Add <Character>(new Character
            {
                CharacterType = Character.Type.Player,
                Clothing      =
                {
                    Clothing.LoadHair("plain_brown"),
                    Clothing.LoadShirt("plain_tee")
                }
            });

            var n = world.Assemble("Npc1", 228 + 512, 128 + 512);
        }