Example #1
0
        /// <summary>
        /// Updates the engine.
        /// </summary>
        private void Update()
        {
            Sfx.UpdateSounds();
            Music.UpdateJams();

            Draw.Update();

            if (FP.Tweener.Active && FP.Tweener._tween != null)
            {
                FP.Tweener.UpdateTweens();
            }

            if (FP._world.Active)
            {
                if (FP._world._tween != null)
                {
                    FP._world.UpdateTweens();
                }

                FP._world.Update();
            }

            FP._world.UpdateLists();

            if (FP._goto != null)
            {
                CheckWorld();
            }
        }
Example #2
0
        public override void Begin()
        {
            base.Begin();
            musics       = new Sfx(Library.GetBuffer("BlackVortex.ogg"));
            musics.Pitch = .5f;
            musics.Loop();


            FP.Engine.ClearColor = FP.Color(0x000000);
            for (int x = 0; x < Sectors.GetLength(0) - 1; x++)
            {
                for (int y = 0; y < Sectors.GetLength(1) - 1; y++)
                {
                    Sectors[x, y]   = new SpaceSector();
                    Sectors[x, y].X = x * Sectors[x, y].Width;
                    Sectors[x, y].Y = y * Sectors[x, y].Height;
                    Add(Sectors[x, y]);
                }
            }
            var e = Add(PlayerShip = new Ship());

            Add(new Part(e, 1, 0, 0));
            for (int i = 0; i < 5; i++)
            {
                Part n = new Part(1);
                n.X = FP.Rand(800);
                n.Y = FP.Rand(800);
                Part nn = new Part(2);
                nn.X = FP.Rand(800);
                nn.Y = FP.Rand(800);
                Add(n);
                Add(nn);
            }
            Add(new Part(e, 3, 0, 0));
            for (int i = 0; i < 30; i++)
            {
                Add(new EmptyShip());
            }

            //FP.Log(WorldHeight);
            //Input.ControllerConnected += (s, e) => Add(new JoystickGuy(e.JoystickId));
            //Input.Pressed(Mouse.Button.Left);
        }