Exemplo n.º 1
0
        public static void Update()
        {
            if (ScreenManager.Mainmenu)
            {
                for (int i = 0; i < FallingObject.ObjectList.Count; i++)
                {
                    FallingObject fallingObject = FallingObject.ObjectList[i];
                    fallingObject.Update();
                    if (fallingObject.Position.Y > 700)
                    {
                        FallingObject.ObjectList.RemoveAt(i);
                        i--;
                    }
                }

                if (pintTimer >= 200)
                {
                    int   x     = 50 + rand.Next(700);
                    float velX  = (float)rand.NextDouble();
                    float scale = 0.4f + (float)rand.NextDouble() * 0.6f;
                    FallingObject.ObjectList.Add(new FallingObject("Chalice", new Vector2(x, -10), new Vector2(0.01f, 0.78f), scale));
                    pintTimer = 0;
                }
                else
                {
                    if (ScreenManager.GameComplete)
                    {
                        pintTimer += rand.Next(7);
                    }
                    pintTimer += rand.Next(2);
                }
            }
        }
Exemplo n.º 2
0
        public static void Draw(SpriteBatch spriteBatch)
        {
            if (ScreenManager.Mainmenu || ScreenManager.Levelselect)
            {
                if (ScreenManager.Credits)
                {
                    spriteBatch.Draw(Textures.GetTexture("SkyB"), Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, 0, 0.8f);
                }
                else
                {
                    spriteBatch.Draw(Textures.GetTexture("SkyA"), Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, 0, 0.8f);
                }

                spriteBatch.Draw(Textures.GetTexture("Cursor"), new Vector2((float)InputManager.Mousestate[0].X, (float)InputManager.Mousestate[0].Y), null, Color.White, 0f, Vector2.Zero, 1f, 0, 1f);
                Button.DrawAll(spriteBatch);
                LevelButton.DrawAll(spriteBatch);
                TextSprite.DrawAll(spriteBatch);
                FallingObject.DrawAll(spriteBatch);
            }
        }