Exemplo n.º 1
0
        public static void CreateDrop(Node context)
        {
            Drop drop = Instance("Drop") as Drop;

            drop.Position = new Vector2(300, 50);
            MainScene.AddChild(drop);
        }
Exemplo n.º 2
0
    public void FinishLoading()
    {
        boardInstance          = (Board)board.Instance();
        boardInstance.Position = scene.GetNode <Node2D>("BoardSpawnPoint").Position;

        ballInstance          = (Ball)ball.Instance();
        ballInstance.Board    = boardInstance;
        ballInstance.Position = scene.GetNode <Node2D>("BallSpawnPoint").Position;

        scene.AddChild(boardInstance);
        scene.AddChild(ballInstance);
        boardInstance.Spawn();

        enemiesManager.Reset();
        Unpause();
    }
Exemplo n.º 3
0
    private void InstanceBlast(Vector2 position)
    {
        var blastInstance = (Node2D)blast.Instance();

        blastInstance.Position = position;
        scene.AddChild(blastInstance);
    }
Exemplo n.º 4
0
    private void SpawnBall(Ball existingBall, float angleOffset)
    {
        var extraBall = (Ball)ballScene.Instance();

        extraBall.MovingAtStart = true;
        extraBall.StartingDir   = Utils.RotateVector(ball.CurrentDir, angleOffset);
        extraBall.Board         = scene.GetNode <Board>("Board");
        extraBall.Position      = ball.Position;
        scene.AddChild(extraBall);
        extraBall.SetSpeed(ball.CurrentSpeed);
    }