Exemple #1
0
 public BaseSelector(Grid inGrid, Texture2D inTexture, Rectangle inRect, int inRow, int inCol)
     : base(inTexture, inRect)
 {
     grid = inGrid;
     originRow = inRow;
     originCol = inCol;
 }
Exemple #2
0
 public TwoByTwoSelector(Grid inGrid, Rectangle inRect, int inRow, int inCol)
     : base(inGrid, TextureRefs.selectorTexture, inRect, inRow, inCol)
 {
     spriteRect.Width = spriteRect.Width * width;
     spriteRect.Height = spriteRect.Height * height;
 }
Exemple #3
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            int gridSize = C.screenWidth - C.xMarginLeft - C.xMarginRight;

            base.Initialize();

            critterManager = new CritterManager();
            cycleCounter = new CycleCounter(TextureRefs.cycleBar, new Rectangle(C.cycleCounterX, C.cycleCounterY, C.cycleCounterWidth, C.cycleCounterHeight));

            totalScoreString = new ScoreString(TextureRefs.pointsTexture, 0, C.totalScoreX, C.totalScoreY);
            currentCyclesString = new ScoreString(TextureRefs.pointsTexture, 0, C.currentCyclesX, C.currentCyclesY);
            targetCyclesString = new ScoreString(TextureRefs.pointsTexture, 0, C.targetCyclesX, C.targetCyclesY);
            finalScoreString = new ScoreString(TextureRefs.pointsTexture, 0, C.finalScoreX, C.finalScoreY);

            grid = new Grid(critterManager, C.xMarginLeft, C.yMargin, gridSize / C.gridCols);
            grid.PlaceSelector(0, 0);

            this.IsMouseVisible = true;
            state = GameState.title;
        }
Exemple #4
0
 public void Initialize(Grid inGrid, int inRow, int inCol, int size)
 {
     grid = inGrid;
     row = inRow;
     col = inCol;
     spriteRect.Width = size;
     spriteRect.Height = size;
     spriteRect.X = col * size + C.xMarginLeft;
     spriteRect.Y = row * size + C.yMargin;
 }