Exemplo n.º 1
0
        public PlayScene()
            : base(2, 2, 1)
        {
            //get next puzzle image
            string puzzleImage = JigsawCore.GetNextImage();

            canvas = new Canvas();
            canvas.Initialize(Core.game.Content);
            this.Add(canvas);

            completedPieces = new GameObjectGroup();
            carriedPieces = new GameObjectGroup();
            puzzle = new Puzzle(completedPieces, carriedPieces);
            puzzle.Create(puzzleImage, 250, canvas);

            this.Add(completedPieces);
            this.Add(puzzle);
            this.Add(carriedPieces);

            player1 = new Player(puzzle, PlayerIndex.One, typeof(SparkleParticle));
            player1.Initialize(Core.game.Content);

            player2 = new Player(puzzle, PlayerIndex.Two, typeof(SparkleParticle));
            player2.Initialize(Core.game.Content);

            this.Add(player2);
            this.Add(player1);

            idleTimer.NotifyMe();
        }
Exemplo n.º 2
0
        public PuzzlePiece(Texture2D texture, Rectangle pieceCoordinates, Puzzle parentPuzzle, Vector2 destinationOffset)
            : base(texture, 100, 2, 20, typeof(HeartParticle))
        {
            ScaleFactor = SCALE_FACTOR;

            _coords = pieceCoordinates;
            _puzzle = parentPuzzle;
            _destinationOffset = destinationOffset;

            _size.X = _coords.Width;
            _size.Y = _coords.Height;
        }
Exemplo n.º 3
0
        public Player(Puzzle puzzle, PlayerIndex playerIndex, Type particleType)
            : base(300, 1.3, 130, particleType)
        {
            ScaleFactor = 2;
            _playerIndex = playerIndex;

            _maxVelocity.X = _maxVelocity.Y = 200;
            _drag.X = _drag.Y = 800;
            _size.X = _size.Y = 32;

            spawnLocation();

            _puzzle = puzzle;
        }