Beispiel #1
0
        public Character(Vector2D position, Vector2D speed, DirectionAnimationCouple animationCouples,
            World world, string animation, int collisionLayer)
            : base(position)
        {
            this.collisionLayer = collisionLayer;
            this.world = world is LayeredWorld ? (LayeredWorld)world : world;

            this.speed = speed;
            this.position = position;
            this.animationCouples = animationCouples;
            this.animation = AnimationGroupManager.GetAnimationGroup(animation);

            this.animation.CurrentAnimation = animationCouples[Direction.Down];
        }
 public void Initialize()
 {
     world = WorldManager.GetWorld("loke");
 }
Beispiel #3
0
        private void SetWorldTeleporters(World world)
        {
            int x;
            int y;
            string target;
            string texture;
            string[] parts;

            for (int i = teleportationIndex + 1; i < lines.Length; i++)
            {
                parts = lines[i].Split(':', ',');
                texture = parts[0];
                x = int.Parse(parts[1]);
                y = int.Parse(parts[2]);
                target = parts[3];

                Teleporter teleporter = new Teleporter(new Vector2D(x, y), target, texture);
                world.AddTeleporter(teleporter);
            }
        }
Beispiel #4
0
        private void SetPlayerPosition(World world)
        {
            int playerX = int.Parse(lines[StringHelper.GetSymbolIndex("player_x:", lines)].Split(':')[1]);
            int playerY = int.Parse(lines[StringHelper.GetSymbolIndex("player_y:", lines)].Split(':')[1]);

            world.PlayerStartPosition = new Vector2D(playerX, playerY);
        }