コード例 #1
1
 public Notification(GameFacet facet, Rectangle location, string text)
     : base(facet)
 {
     this.text = text;
     this.location = location;
     alpha = 255;
 }
コード例 #2
1
 public Notification(GameFacet facet, string filename, Rectangle location)
     : base(facet)
 {
     this.filename = filename;
     this.location = location;
     alpha = 255;
 }
コード例 #3
0
ファイル: Field.cs プロジェクト: Cheezmeister/Chromathud
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="x">X coordinate of the top-left corner</param>
        /// <param name="y">Y coordinate of the top-left corner</param>
        public Field(GameFacet f, int x, int y)
            : base(f)
        {
            area = new Rectangle(x, y, Width, Height);

            tiles = new List<List<Block>>();
            selected = new List<Block>();
            fallingblocks = new List<Block>();
            dead = new List<Block>();
            shouldfall = new bool[NUM_COLUMNS];
            pushcounter = 0;
            rand = new Random((int)(DateTime.Now.Ticks % int.MaxValue));
            lastsum = DateTime.Now.Ticks;

            TopBar = new TopBar(this, Area);
            Score = new Score() { Mode = Facet.GameplayMode.ToString()  };
            if (Facet.GameplayMode == GameplayMode.Timed)
                Score.Mode += Facet.ClockTime.Minutes;

            for (int i = 0; i < NUM_ROWS; ++i)
            {

                tiles.Add(new List<Block>(NUM_COLUMNS));
                for (int j = 0; j < NUM_COLUMNS; ++j)
                {
                    tiles[i].Add(null);
                }
            }

            //put the first four rows in right away
            for (int i = 0; i < 4; ++i)
                pushBlocks();

            // cursor.X = 5;
            // cursor.Y = 13;

            Target = RerollTarget(9); //never gonna give you up
        }
コード例 #4
0
 /// <summary>
 /// Construct a tutorial message to introduce a single aspect of gameplay
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="message"></param>
 /// <param name="delayMS"></param>
 public TutorialMessage(GameFacet parent, string message, Rectangle area)
     : base(parent.FacetManager)
 {
     this.parent = parent;
     text = Util.SubstituteButtonChars(message);
     //text = Util.WrapToAspect(text, (area.Width / area.Height));
     text = Util.WrapToLength(text, 24); // HACK
     this.Area = area;
 }