Inheritance: GameEntity
        public FlappyDogeScene()
            : base()
        {
            ClearColor = new Microsoft.Xna.Framework.Color(74, 195, 206);

            container = new DisplayObject() { Y = 200 };

            container.AddNode(new Sprite("Scenes//Flappy//clouds"));
            container.AddNode(new Sprite("Scenes//Flappy//buildings") { Y = 65 });
            container.AddNode(new Sprite("Scenes//Flappy//buildings") { Y = 65, X = 180 });
            container.AddNode(new Sprite("Scenes//Flappy//buildings") { Y = 65, X = 180 * 2 });
            container.AddNode(new Sprite("Scenes//Flappy//buildings") { Y = 65, X = 180 * 3 });

            floor = new DisplayObject() { Y = 65 + 165 + 200 };

            for (int i = 0; i < 20; i++)
            {
                floor.AddNode(new Sprite("Scenes//Flappy//floor") { X = 60 * i });
            }

            doge = new Sprite("Scenes//Flappy//birds");

            AddNode(container);
            AddNode(floor);
            AddNode(doge);

            GeneratePipe();
        }
Example #2
0
        public NodeTest()
            : base("", "")
        {
            car = new DisplayObject();
            car.Position = new Vector2(100, 100);

            car.AddNode(wheel1 = new Sprite("Scenes//Demo1//wheel") { Position = new Vector2(16 + 24, 50 + 20), AutoCenter = true });
            car.AddNode(wheel2 = new Sprite("Scenes//Demo1//wheel") { Position = new Vector2(230 + 24, 50 + 20), AutoCenter = true });
            car.AddNode(window = new Sprite("Scenes//Demo1//window") { Position = new Vector2(125, 5) });
            car.AddNode(new Sprite("Scenes//Demo1//body") { AutoCenter = false });

            AddNode(container = new GameEntity());
            container.AddNode(car);

            new SceneView(this).Show();
        }
Example #3
0
        public Demo1Scene()
            : base(TITLE, DESCRIPTION)
        {
            background = new Sprite("Scenes//Global//background");

            world = new Sprite("Scenes//Demo1//world")
            {
                AutoCenter = true
            };

            clouds = new Sprite("Scenes//Demo1//clouds")
            {
                Origin = new Vector2(750, 750)
            };

            AddNode(background);
            AddNode(planet = new DisplayObject() { Position = Globals.ScreenCenter });
            planet.AddNode(world);
            planet.AddNode(clouds);
        }
        private void GeneratePipe()
        {
            DisplayObject pipe = new DisplayObject() { Name = "Pipe" };

            Sprite pipeBot = new Sprite("Scenes//Flappy//pipeB") { X = 300, Y = 300, };
            pipe.AddNode(pipeBot);

            Sprite pipeTop = new Sprite("Scenes//Flappy//pipe") { X = 300, Y = -600 };
            pipe.AddNode(pipeTop);

            AddNode(pipe);

            Pipes.Add(pipe);

            pipe.Y = (float)(Globals.Random.NextDouble() * 200) - 100;

            new Wait(1400, () =>
            {
                GeneratePipe();
            });
        }