Exemplo n.º 1
0
        static void Main(string[] args)
        {
            string path;
            string name;

            Console.WriteLine("Working directory is " + Directory.GetCurrentDirectory());

            Console.WriteLine("Enter the relative path of the sprite sheet texture: ");
            path = Console.ReadLine();

            Console.WriteLine("Make a new character (y/n): ");
            while (Console.ReadLine().ToLower().StartsWith("y") == true)
            {
                Console.WriteLine("Enter the name of the character to create: ");
                name = Console.ReadLine();

                spritesheet = new Spritesheet(Directory.GetCurrentDirectory() + "\\" + path);
                if (spritesheet == null)
                {
                    Console.WriteLine("Error loading sprite sheet. Exiting program.");
                    return;
                }

                Character character = new Character(name, spritesheet);

                Console.WriteLine("Enter the x tile index: ");
                int x = int.Parse(Console.ReadLine());

                Console.WriteLine("Enter the y tile index: ");
                int y = int.Parse(Console.ReadLine());

                Layer layer = new Layer("base", new System.Drawing.Point(x, y));
                character.AddLayer(layer);

                Console.WriteLine(character.ToString());

                characters.Add(character);

                Console.WriteLine("Make a new character (y/n): ");
            }

            Console.Clear();

            foreach (Character character in characters)
            {
                Console.WriteLine(character.ToString());
            }

            Console.ReadKey();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            WriteLine("Working directory is " + Directory.GetCurrentDirectory());

            WriteLine("Enter the relative path of the sprite sheet texture: ");
            var path = ReadLine();

            Console.WriteLine("Make a new character (y/n): ");
            while (Console.ReadLine().ToLower().StartsWith("y") == true)
            {
                WriteLine("Enter the name of the character to create: ");
                var name = ReadLine();

                spritesheet = new Spritesheet(Directory.GetCurrentDirectory() + "\\" + path);
                if (spritesheet == null)
                {
                    WriteLine("Error loading sprite sheet. Exiting program.");
                    return;
                }

                character = new Character(name, spritesheet);

                WriteLine("Enter the x tile index: ");
                var x = int.Parse(ReadLine());
                Console.WriteLine("Enter the y tile index: ");
                var y = int.Parse(ReadLine());

                character.tileCoordinates = new System.Drawing.Point(x, y);
                characters.Add(character);
                Console.WriteLine("Make a new character (y/n): ");
            }

            Console.Clear();
            foreach (Character character in characters)
            {
                Console.WriteLine(character.ToString());
            }

            var containerStuff = new Container_stuff();

            containerStuff.ArrayExample(5);
            ReadKey();
        }