Ejemplo n.º 1
0
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            RenderTarget renderTarget = RenderTarget.Create();

            renderTarget.Window.Icon             = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
            renderTarget.Window.Title            = "Flying Bird";
            renderTarget.Window.CursorVisibility = true;
            renderTarget.Window.SurfaceLayout    = new SurfaceLayout(true, false, true);

            SGL.Initialize();

            SGL.Components.Get <GraphicsDevice>().ClearColor = Color.FromArgb(255, 128, 197, 205);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Zeichnen der Elemente
        /// </summary>
        /// <param name="spriteBatch"></param>
        /// <param name="gameTime"></param>
        public override void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            switch (SceneMode)
            {
                case SceneMode.FirstStart:
                    text = "Bereit?";
                    gameScene.Draw(spriteBatch, gameTime);
                    break;

                case SceneMode.Paused:
                    text = "Pausiert";
                    break;

                case SceneMode.WonLost:
                    break;

                case SceneMode.Scored:
                    text = "Bereit?";
                    gameScene.Draw(spriteBatch, gameTime);
                    break;

                default:
                    break;
            }
            font = new Font("Arial", 50, TypefaceStyle.Bold);
            position = new Vector2()
            {
                X = (graphicsDevice.BackBuffer.Width - spriteBatch.MeasureString(text, font).X) / 2,
                Y = 100
            };
            color = Color.White;
            spriteBatch.DrawString(text, font, position, color);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a new DamageIndicator.
 /// </summary>
 /// <param name="position">The Position.</param>
 /// <param name="score">The Score.</param>
 /// <param name="color">The Color.</param>
 private void CreateScoreIndicator(Vector2 position, int score, Color color)
 {
     var indicator = new ScoreIndicator {Position = position, Score = score, Color = color};
     _scoreIndicators.Add(indicator);
 }