コード例 #1
0
ファイル: PlayScene.cs プロジェクト: elib/jigsaw
        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();
        }
コード例 #2
0
ファイル: PuzzlePiece.cs プロジェクト: elib/jigsaw
        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;
        }
コード例 #3
0
ファイル: Player.cs プロジェクト: elib/jigsaw
        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;
        }