Ejemplo n.º 1
0
        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            KeyboardState kb = Keyboard.GetState();
            if ( (kb.IsKeyDown(Keys.Space) && !kbOld.IsKeyDown(Keys.Space)) ||
                (kb.IsKeyDown(Keys.Right) && !kbOld.IsKeyDown(Keys.Right)) )
            {
                if (channel < channels.Count-1)
                {
                    channel++;
                    ChannelMgr.ZapTo(channels[channel]);
                }
            }
            else if (kb.IsKeyDown(Keys.Left) && !kbOld.IsKeyDown(Keys.Left))
            {
                if (channel > 0)
                {
                    channel--;
                    ChannelMgr.ZapTo(channels[channel]);
                }
            }
            else if (kb.IsKeyDown(Keys.Escape) && !kbOld.IsKeyDown(Keys.Escape))
            {
                Exit();
            }
            kbOld = kb;
        }
Ejemplo n.º 2
0
        protected override void LoadContent()
        {
            base.LoadContent();

            // Here all the tests are listed
            DoTest(new TestLinearMotion());
            DoTest(new TestRotation());
            DoTest(new TestRelativeMotion());

            ChannelMgr.ZapTo(channels[0]);

        }       
Ejemplo n.º 3
0
        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            KeyboardState kb = Keyboard.GetState();

            if (kb.IsKeyDown(Keys.Space))
            {
                ChannelMgr.ZapTo(titleChannel);
            }
            else
            {
                ChannelMgr.ZapTo(gameChannel);
            }
        }
Ejemplo n.º 4
0
        protected override void LoadContent()
        {
            base.LoadContent();

            // game channel
            gameChannel = ChannelMgr.CreateChannel();
            ChannelMgr.ZapTo(gameChannel);
            gameChannel.Screen.GetComponent <ScreenComp>().BackgroundColor = Color.Black;
            gameChannel.Screen.GetComponent <ScreenComp>().Zoom            = 2.0f;

            // add framerate counter
            FrameRateCounter.Create(Color.White);

            // create level
            level = new QuestLevel();
            Level.SetCurrentLevel(level);
            level.Init();
        }
Ejemplo n.º 5
0
        protected override void LoadContent()
        {
            base.LoadContent();

            // title channel
            titleChannel = ChannelMgr.CreateChannel();
            ChannelMgr.ZapTo(titleChannel); // TODO function to create on it without seeing it.
            titleChannel.Screen.GetComponent <ScreenComp>().BackgroundColor = Color.Black;

            // add framerate counter
            FrameRateCounter.Create(Color.White);

            var t = Factory.CreateMovingTextlet(new Vector2(0.5f, 0.5f), "Title Screen");

            t.GetComponent <DrawComp>().DrawColor = Color.LightGoldenrodYellow;
            t.GetComponent <ScaleComp>().Scale    = 4;


            // game channel
            gameChannel = ChannelMgr.CreateChannel();
            ChannelMgr.ZapTo(gameChannel);
            gameChannel.Screen.GetComponent <ScreenComp>().BackgroundColor = Color.White;

            // add framerate counter
            FrameRateCounter.Create(Color.Black);

            // add several sprites
            for (float x = 0.1f; x < 1.6f; x += 0.1f)
            {
                for (float y = 0.1f; y < 1f; y += 0.1f)
                {
                    Factory.CreateHyperActiveBall(new Vector2(x, y));
                    Factory.CreateMovingTextlet(new Vector2(x, y), "This is the\nTTengine test. !@#$1234");
                    //break;
                }
                //break;
            }
        }