Exemple #1
0
    public InGamePage()
    {
        _background = new FSprite("JungleBlurryBG");
        AddChild(_background);

        _player1 = new PDPaddle("Player1");
        _player2 = new PDPaddle("Player2");
        _ball    = new PDBall();
        ResetPaddles();
        ResetBall();
        AddChild(_player1);
        AddChild(_player2);
        AddChild(_ball);
        ListenForUpdate(Update);

        lblScore1         = new FLabel("arial", _player1.name + ": " + _player1.score);
        lblScore1.anchorX = 0;
        lblScore1.anchorY = 0;
        lblScore1.x       = -Futile.screen.halfWidth;
        lblScore1.y       = -Futile.screen.halfHeight;

        lblScore2         = new FLabel("arial", _player2.name + ": " + _player2.score);
        lblScore2.anchorX = 1.0f;         //Anchor at the right edge.
        lblScore2.anchorY = 0;
        lblScore2.x       = Futile.screen.halfWidth;
        lblScore2.y       = -Futile.screen.halfHeight;

        AddChild(lblScore1);
        AddChild(lblScore2);
    }
Exemple #2
0
    public PDGame()
    {
        player1 = new PDPaddle("player1");
        player2 = new PDPaddle("player2");
        ResetPaddles();

        ball = new PDBall();
        ball.Reset();

        Futile.stage.AddChild(player1);
        Futile.stage.AddChild(player2);
        Futile.stage.AddChild(ball);
    }
Exemple #3
0
    public PDGame()
    {
        player1 = new PDPaddle("player1", "w", "s");
        player2 = new PDPaddle("player2", "up", "down");
        ResetPaddles();

        ball = new PDBall();
        ResetBall();

        mouse = new MyMouse();

        Futile.stage.AddChild(player1);
        Futile.stage.AddChild(player2);
        Futile.stage.AddChild(ball);
    }
Exemple #4
0
    public PDGame()
    {
        player1 = new PDPaddle("player1", "w", "s");
        player2 = new PDPaddle("player2", "up", "down");
        ResetPaddles();

        ball = new PDBall();
        ResetBall();

        mouse = new MyMouse();

        Futile.stage.AddChild(player1);
        Futile.stage.AddChild(player2);
        Futile.stage.AddChild(ball);
    }