コード例 #1
0
ファイル: Game1.cs プロジェクト: Kauko/fallingGGJ12
        /// <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()
        {
            // TODO: Add your initialization logic here

            this.IsMouseVisible = true;
            state = GameState.title;
            currentPlayer = new Player();

            frameImageManager = new FrameImageManager();

            base.Initialize();
            camera = new Camera2D(spriteBatch);
            grid = new Grid(C.xMarginLeft, C.yMargin, C.tileWidth, C.tileHeight, camera);
            grid.setCurrentPlayer(currentPlayer);
            grid.initJewels(frameImageManager);
            turnString = new TurnString(TextureRefs.turnsTexture, 0, C.turnsX, C.turnsY);
        }
コード例 #2
0
ファイル: Grid.cs プロジェクト: Kauko/fallingGGJ12
 public void initJewels(FrameImageManager frameImageManager)
 {
     jewels.Add(new Jewel(TextureRefs.jewel1, frameImageManager.getFrameImage(0)));
     jewels.Add(new Jewel(TextureRefs.jewel2, frameImageManager.getFrameImage(4)));
     jewels.Add(new Jewel(TextureRefs.jewel3, frameImageManager.getFrameImage(6)));
     jewels.Add(new Jewel(TextureRefs.jewel4, frameImageManager.getFrameImage(1)));
     jewels.Add(new Jewel(TextureRefs.jewel5, frameImageManager.getFrameImage(2)));
     jewels.Add(new Jewel(TextureRefs.jewel6, frameImageManager.getFrameImage(3)));
     jewels.Add(new Jewel(TextureRefs.jewel7, frameImageManager.getFrameImage(5)));
 }