コード例 #1
0
ファイル: TextboxPopup.cs プロジェクト: koaset/notTetris
 public TextboxPopup(string info, int charLimit)
 {
     infoText = new Text();
     text = new Text();
     this.info = info;
     this.charLimit = charLimit;
 }
コード例 #2
0
ファイル: HighscoreScreen.cs プロジェクト: koaset/notTetris
 public HighscoreScreen()
 {
     backgroundImage = new Image();
     header = new Text();
     highscores = new Text[5];
     backButton = new TextButton();
     cursor = new Cursor();
 }
コード例 #3
0
ファイル: SinglePlayerGame.cs プロジェクト: koaset/notTetris
 public SinglePlayerGame(Settings settings)
 {
     playerOneField = new Playfield(GameType.Time, new Vector2(500f, 325f), settings.PlayfieldSize);
     backgroundImage = new Image();
     pauseImage = new Image();
     startText = new Text();
     timer = new Text();
 }
コード例 #4
0
ファイル: SplitScreenGame.cs プロジェクト: koaset/notTetris
 public SplitScreenGame(Settings settings)
 {
     playerOneField = new Playfield(settings.GameType, new Vector2(780f, 325f), settings.PlayfieldSize);
     playerTwoField = new Playfield(settings.GameType, new Vector2(300f, 325f), settings.PlayfieldSize);
     backgroundImage = new Image();
     pauseImage = new Image();
     timer = new Text();
 }
コード例 #5
0
ファイル: ResultsScreen.cs プロジェクト: koaset/notTetris
 public ResultsScreen(GameResult results, bool isNetwork)
 {
     this.results = results;
     this.isNetwork = isNetwork;
     backGroundImage = new Image();
     gameoverText = new Text();
     infoText = new Text();
     results = new GameResult();
     time = new Text();
     p1Score = new Text();
     p2Score = new Text();
     cursor = new Cursor();
 }
コード例 #6
0
ファイル: NetworkGame.cs プロジェクト: koaset/notTetris
 public NetworkGame(Settings settings, NetPeer peer)
 {
     this.settings = settings;
     this.peer = peer;
     localPlayerField = new Playfield(settings.GameType, new Vector2(780f, 325f), settings.PlayfieldSize);
     remotePlayerField = new RemotePlayfield(settings.GameType, new Vector2(300f, 325f), settings.PlayfieldSize);
     xDiff = localPlayerField.Position.X - remotePlayerField.Position.X;
     backgroundImage = new Image();
     pauseImage = new Image();
     timeText = new Text();
     countdownText = new OutlineText();
     if (peer.ConnectionsCount == 0)
         NewScreen(new NetworkGameSetup(), "No Connection");
     else
         connection = peer.Connections.ToArray()[0];
 }
コード例 #7
0
ファイル: HighscoreScreen.cs プロジェクト: koaset/notTetris
        public override void Initialize(SpriteBatch spriteBatch, Settings settings)
        {
            backgroundImage.Initialize();
            backgroundImage.Layer = 0.1f;
            backgroundImage.Position = new Vector2(500, 360);
            backgroundImage.Size = new Vector2(1000, 720);
            backgroundImage.TextureName = TextureNames.game_background;

            backButton.Initialize();
            backButton.Text = "Back";
            backButton.Position = new Vector2(100, 620);
            backButton.Click += new ButtonEventHandler(OnBack);

            header.Initialize();
            header.Font = FontNames.Segoe_UI_Mono;
            header.Layer = 0.7f;
            header.IsCentered = true;
            header.Position = new Vector2(500, 100);
            header.TextColor = Color.Navy;
            header.TextValue = "Single Player\n High Score";

            cursor.Initialize();

            for (int i = 0; i < highscores.Length; i++)
            {
                highscores[i] = new Text();
                highscores[i].Initialize();
                highscores[i].Font = FontNames.Segoe_UI_Mono;
                highscores[i].Layer = 0.7f;
                highscores[i].Position = new Vector2(375, 175 + i * 75);
                highscores[i].TextColor = Color.MintCream;
                int num = i + 1;
                highscores[i].TextValue = num.ToString() + ":    " + settings.score[i].ToString("F0");
            }

            base.Initialize(spriteBatch, settings);
        }
コード例 #8
0
ファイル: ScoreCounter.cs プロジェクト: koaset/notTetris
 public ScoreCounter()
 {
     text = new Text();
 }
コード例 #9
0
ファイル: Playfield.cs プロジェクト: koaset/notTetris
        public Playfield(GameType gameType, Vector2 position, int sizeX)
        {
            this.gameType = gameType;
            this.Position = position;
            if (sizeX % 2 == 0)
                sizeX--;
            blockSize = Width / sizeX;
            int sizeY = (int)(Height / blockSize);

            maxBlocks = (sizeX - 1) * sizeY + 2;
            blocks = new List<Block>(maxBlocks);
            explodingBlocks = new List<Block>();
            BlackBlocksQueued = 0;
            backgroundImage = new Image();
            cutoffLine = new Image();

            scoreCounter = new ScoreCounter();
            scoreFloater = new ScoreFloater();
            scale = new Vector2(blockSize / Block.STANDARDSIZE);
            staticBlocks = new Block[sizeX, sizeY];
            startingColumn = (sizeX + 1) / 2;

            blockImages = new Image[Enum.GetNames(typeof(BlockType)).Length];
            for (int i = 0; i < blockImages.Length; i++)
                blockImages[i] = new Image();
            explosionAnimation = new Animation();
            largestComboText = new Text();

            stateText = new Text();
        }