Esempio n. 1
0
        public override void Draw(GameTime gameTime)
        {
            ScreenManager.GraphicsDevice.Clear(Color.CornflowerBlue);
            spriteBatch.Begin();

            if (Globals.Instance.light)
            {
                BackgroundL.Draw(spriteBatch);
                spriteBatch.Draw(sunL, new Rectangle(0, 0, 195, 195), Color.White);
                FloorBackgroundL.Draw(spriteBatch);
                CloudBackgroundL.Draw(spriteBatch);

                foreach (Platform p in LplatformList)
                {
                    p.Draw(spriteBatch, Color.White, viewport);
                }
            }
            else
            {
                BackgroundD.Draw(spriteBatch);
                spriteBatch.Draw(sunD, new Rectangle(0, 0, 195, 195), Color.White);
                FloorBackgroundD.Draw(spriteBatch);
                CloudBackgroundD.Draw(spriteBatch);
                spriteBatch.Draw(pit, new Rectangle((int)pitposition, 710, 256, 512), Color.White);

                foreach (Platform p in DplatformList)
                {
                    p.Draw(spriteBatch, Color.White, viewport);
                }
            }

            enemy.Draw(gameTime, spriteBatch, Color.White);
            portal.Draw(gameTime, spriteBatch, Color.White);
            player.Draw(spriteBatch, viewport);

            spriteBatch.DrawString(Art.Font, "Use left and right to move", new Vector2(100 + textMod, 75), Color.Tomato);
            spriteBatch.DrawString(Art.Font, "Use space to jump", new Vector2(120 + textMod, 125), Color.Tomato);
            spriteBatch.DrawString(Art.Font, "Use 'V' to switch worlds", new Vector2(390 + textMod, 300), Color.Tomato);
            spriteBatch.DrawString(Art.Font, "Avoid the trap and reach the portal", new Vector2(1200 + textMod, 300), Color.Tomato);

            spriteBatch.End();
        }