예제 #1
0
        //Super Xblox 360 Text Was here now blank
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public TitleScreen(ScreenManager sm)
            : base(sm,"")
        {
            //Storage.LoadSettings();
            Storage.LoadHighScores();

            MediaPlayer.Volume = Storage.getsettings()[1] *(0.01f);
            //OptionsMenuScreen.soundVolume = Storage.getsettings()[0];
            svolume = Storage.getsettings()[0];
            mvolume = Storage.getsettings()[1];

            // show the controller images
            show_playercontrol = false;

            // Create our menu entries.
            MenuEntry PlayMenuEntry = new MenuEntry("");
            // Hook up menu event handlers.
            PlayMenuEntry.Selected += PlayMenuEntrySelected;

            // Add entries to the menu.
            MenuEntries.Add(PlayMenuEntry);
            //blockpositions = new Vector2[100];
               // flying_blocks = new Block[100];
            flying_shapes=new Shape[100];
            random=new Random();
            //blockcolors = new Color[100];
            for (int i = 0; i < 50; i++)
            {
                //blockpositions[i] = new Vector2();
                //flying_blocks[i] = new Block();

                //flying_blocks[i].blockcolor.A = 255;
                //flying_blocks[i].blockcolor.R = (byte)(int)(r.NextDouble() * 255);
                //flying_blocks[i].blockcolor.G = (byte)(int)(r.NextDouble() * 255);
                //flying_blocks[i].blockcolor.B = (byte)(int)(r.NextDouble() * 255);

                int X = (int)(random.NextDouble() * 1400) - 250;
                 int Y = (int)(random.NextDouble() * 1200) - 250;
                flying_shapes[i] = new Shape(X,Y);
                flying_shapes[i].Rotation = random.Next(0, 4);
                flying_shapes[i].Type = (Shape.ShapeType)(int)(random.NextDouble() * 13);
            }
        }
예제 #2
0
        //Description: Create a new random shape
        private void CreateNewShape()
        {
            if (mNextShape.Type == Shape.ShapeType.NotSet)
            {
                mNextShape.Type = ((Shape.ShapeType)(RandomNumber(0, 8)));
            }//end if (mNextShape.Type == Shape.ShapeType.NotSet)
            mCurrentShape = mNextShape;

               // mCurrentShape.Type = mNextShape.Type;
               // for (int i = 0; i < mCurrentShape.mNumberOfBlocks; i++)
               // mCurrentShape.Blocks[i] = mNextShape.Blocks[i];
            mCurrentShape.DrawPositionY = 30;
               // mCurrentShape.DrawPositionX = mNextShape.DrawPositionX;
            mNextShape = new Shape(mPlayfield, true, true);

            mNextShape.Type = ((Shape.ShapeType)(RandomNumber(0, 8)));

            //Randomly set the block types of the new shape
               // int bt = RandomNumber(0, 8);
             //   for (int i = 0; i < mNextShape.mNumberOfBlocks; i++)
               //     mNextShape.Blocks[i].Type = (Block.BlockType)bt;

               // mCurrentShape.PositionX = 0;
               // mCurrentShape.PositionY = 0;
            mCurrentShape.Rotation = 0;
        }
예제 #3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public GameplayScreen(ScreenManager sm)
            : base(sm)
        {
            TransitionOnTime = TimeSpan.FromSeconds(1.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);

              //  mSound = (Sound)ScreenManager.Game.Components[4];
            mCurrentShape = new Shape(mPlayfield, true, true);
            mNextShape = new Shape(mPlayfield, true, true);
            mNextShape.DrawPositionX = 400;
            mNextShape.DrawPositionY = 10;
        }
예제 #4
0
 public void copy(Shape s)
 {
     this.Type = s.mType;
     for(int i=0;i<this.mNumberOfBlocks;i++)
         this.Blocks[i] = s.Blocks[i];
        // this.DrawPositionX = s.DrawPositionX;
       //  this.DrawPositionY = s.DrawPositionY;
 }
예제 #5
0
        public void CreateNewShape()
        {
            //mCurrentShape.Type = mNextShape.Type;
            //for (int i = 0; i < mCurrentShape.mNumberOfBlocks; i++)
               // mCurrentShape.Blocks[i] = mNextShape.Blocks[i];
            //Copy the next shape to the current
            mCurrentShape = new Shape(mPlayfield, linkedblocks, randomblocks);
            mCurrentShape = mNextShape;

            //Set the starting position  in the play area
              //  mCurrentShape.DrawPositionY = mPlayfield.Ypos;
               // mCurrentShape.DrawPositionX = mPlayfield.Xpos + 24 * (mPlayfield.Width / 2);

            //Create a new shape for the nextshape
            mNextShape = new Shape(mPlayfield, linkedblocks, randomblocks);
            mNextShape.DrawPositionX = mCurrentShape.DrawPositionX;

            mNextShape.Type = (Shape.ShapeType)(RandomNumber(0, shapelimit));
                 //rotation to zero?
            mCurrentShape.Rotation = 0;
        }
예제 #6
0
        public void startnewgame()
        {
            playgosound = true;
            mSound.Play(Sound.SoundFX.Start);
            mCurrentShape = new Shape(mPlayfield, linkedblocks, randomblocks);
            mNextShape = new Shape(mPlayfield, linkedblocks, randomblocks);

            if (autoFallNumber == 1)
            {
               // mCurrentShape.DrawPositionY = 150;
                mNextShape.Type = ((Shape.ShapeType)(RandomNumber(0, 8)));
                mCurrentShape.Type = ((Shape.ShapeType)(RandomNumber(0, 8)));
            }
            else
            {
                mAutoFallThreshold = 1.0f;
                mNextShape.Type = ((Shape.ShapeType)(RandomNumber(0, 6)));
                mCurrentShape.Type = ((Shape.ShapeType)(RandomNumber(0, 6)));
            }

            mPlayfield.ClearPlayfield();
            mScore = 0;

            //mNumberOfLinesCleared = 0;
            mTotalLines = 0;
            mLevel = 0;
        }