Inheritance: Character, IAvatar
Esempio n. 1
0
        private static Avatar LoadAgent(TmxObject avatar, List<Tileset> tilesets)
        {
            var initialPosition = new Vector2(avatar.X, avatar.Y);
            var size = new Vector2(avatar.Width, avatar.Height);
            float rotation = avatar.Rotation;

            int originalGid = avatar.Gid;
            Tuple<string, int> nameNewGid = TilesetNameFromGid(tilesets, originalGid);
            string tilesetName = nameNewGid.Item1;
            int newGid = nameNewGid.Item2;

            var gameAvatar = new Avatar(tilesetName, newGid, avatar.Name, avatar.Id, initialPosition, size, rotation);

            // this is magic
            if (avatar.Properties != null)
            {
                SetGameObjectProperties(avatar.Properties.PropertiesList, gameAvatar);
            }

            return gameAvatar;
        }
Esempio n. 2
0
 public AvatarTests()
 {
     m_avatar = new Avatar("", 0, "Pingu", 0, Vector2.Zero, Vector2.One);
 }
 public BasicAvatarMoverTest()
 {
     m_avatar = new Avatar("", 0, "Pingu", 0, Vector2.Zero, Vector2.One);
     m_basicAvatarMover = new BasicAvatarMover();
     BasicAvatarMover basicAvatarMover = m_basicAvatarMover;
 }