예제 #1
0
        private void restartGame()
        {
            startFallingBalls = false;

            level = new Level_2(textures, spriteBatch);
            level.overlay = overlay;
        }
예제 #2
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            mouseController = new MouseController(this, spriteBatch);
            mouseController.LoadContent();

            textures = new List<Texture2D>();
            textures.Add(Content.Load<Texture2D>("Sprites\\Square"));   // textures[0]
            textures.Add(Content.Load<Texture2D>("Sprites\\Circle2"));  // textures[1]
            textures.Add(Content.Load<Texture2D>("Sprites\\Diamond"));  // textures[2]
            textures.Add(Content.Load<Texture2D>("Sprites\\Flower"));   // textures[3]
            textures.Add(Content.Load<Texture2D>("Sprites\\Pepper"));   // textures[4]
            textures.Add(Content.Load<Texture2D>("Sprites\\Smiley"));   // textures[5]
            textures.Add(Content.Load<Texture2D>("Sprites\\Sun"));      // textures[6]
            textures.Add(Content.Load<Texture2D>("Sprites\\Triangle")); // textures[7]
            textures.Add(Content.Load<Texture2D>("Sprites\\background_stones")); // textures[8]

            level = new Level_2(textures, spriteBatch);
            level.overlay = overlay;

            offset = new Vector2(0, 0); // move of the full gamefield
            playerOffset = new Vector2(0, 0);
            cursorOffset = new Vector2(0, 0);

            if ((float)(level.size.Y) / (float)(level.size.X) > 1.0f)
            {
                minimapScale = 0.2f / ((float)(level.size.Y) / (float)(level.size.X));
            }
            else
            {
                minimapScale = 0.2f;
            }
            gameScale = 0.8f;
            Window_ClientSizeChanged( null, null);  // sets the minimapoffset vector
            scrollBackDelay = maxScrollBackDelay;

            //if (level.addObjects.objects.Count > 0)
            //{
            //    cursor = level.addObjects.objects[0];
            //    cursor.color = new Color( cursor.color.R, cursor.color.G, cursor.color.B, cursor.color.A / 2);
            //    level.addObjects.remove(cursor);
            //}

            bottomReachedEffect = Content.Load<SoundEffect>("Sounds/bottomReached");
            collicionEffect = Content.Load<SoundEffect>("Sounds/hyperspace_activate");
            bonusEffect = Content.Load<SoundEffect>("Sounds/bonus");
            bodyclickedEffect = Content.Load<SoundEffect>("Sounds/tong");
            bodyPlacedEffect = Content.Load<SoundEffect>("Sounds/click");
            endGameEffect = Content.Load<SoundEffect>("Sounds/hyperspace_activate");
            lostGameEffect = Content.Load<SoundEffect>("Sounds/gameLost");
        }