コード例 #1
0
ファイル: GameView.cs プロジェクト: MSigma/ZooBurst
        public GameView(Point viewSize, Point tileSize, Level level)
        {
            ViewSize = viewSize;
            TileSize = tileSize;

            SelectedSprite = new Sprite { BaseAlpha = 0.35F };

            var baseLayer = new Layer
            {
                BackgroundTexture = Assets.GetTexture("background"),
                Size = ViewSize
            };

            AnimalLayer = new Layer();
            baseLayer.AddChild(AnimalLayer);
            AddChild(baseLayer);

            ValidSwapAnimation = new AnimationValidSwap();
            InvalidSwapAnimation = new AnimationInvalidSwap();
            MatchAnimation = new AnimationMatches();
            FallingAnimalsAnimation = new AnimationFallingAnimals();
            NewAnimalsAnimation = new AnimationNewAnimals();

            Level = level;
            Level.ComboMultiplier = 1;
            RefreshLayers();
        }
コード例 #2
0
ファイル: Controller.cs プロジェクト: MSigma/ZooBurst
        public Controller(Level level, GameView view)
        {
            View = view;
            Level = level;

            _helpTimerStart = DateTime.Now;

            Restart();
        }
コード例 #3
0
ファイル: Game.cs プロジェクト: MSigma/ZooBurst
        protected override void Initialize()
        {
            base.Initialize();

            var mersenneTwister = new MersenneTwister();

            var loader = new LevelLoader();
            var firstLevel = new Level(loader.Load("Content/first"), mersenneTwister);
            var view = new GameView(new Point(Graphics.PreferredBackBufferWidth, Graphics.PreferredBackBufferHeight), new Point(64, 64), firstLevel);

            _controller = new Controller(firstLevel, view);
            var input = new MouseInputHandler(_controller, view);
            input.Swap += _controller.SwapAnimals;
        }