Exemple #1
0
    private void StopGame()
    {
        map.QueueFree();
        //Change the shader for the end game screens
        SetShaderEvent ssei = new SetShaderEvent();

        ssei.showBlurAndWater = true;
        ssei.FireEvent();

        ((Node2D)camera).Position = new Vector2(640, 360);
        //Set the camera back to the main scene
        CameraEvent cei = new CameraEvent();

        //cei.target = (Node2D)redBlob.GetParent();
        cei.target = (Node2D)this;
        cei.dragMarginHorizontal = false;
        cei.dragMarginVertical   = false;
        cei.FireEvent();

        for (int i = 0; i < blueBlobsList.Count; i++)
        {
            blueBlobsList[i].QueueFree();
        }
        for (int i = 0; i < greenBlobList.Count; i++)
        {
            greenBlobList[i].QueueFree();
        }

        redBlob.QueueFree();
    }
Exemple #2
0
    private void StartGame()
    {
        SetShaderEvent ssei = new SetShaderEvent();

        ssei.showBlur = true;
        ssei.FireEvent();
        //Instance the map and set it as a child of the main scene
        map = mapScene.Instance();
        //Set the map as the child of the main scene
        AddChild(map);
        //Instance thet reb blob scene
        redBlob = redBlobScene.Instance();
        //Set the blobs spawn position
        ((Node2D)redBlob).Position = new Vector2(300, 300);
        //Add the reb blob as a child of the main scene
        AddChild(redBlob);

        ((Node2D)camera).Position = new Vector2(0, 0);
        CameraEvent cei = new CameraEvent();

        cei.target = (Node2D)redBlob;
        cei.dragMarginHorizontal = true;
        cei.dragMarginVertical   = true;
        cei.FireEvent();

        SpawnGreenBlobs();
        SpawnBlueBlobs();
    }
Exemple #3
0
    private void InstatiateScenes()
    {
        //Init needed background sytems
        //Instance the input manager and set it as a child of the main scene
        inputManager = inputManagerScene.Instance();
        //Set the input manager as the child of the main scene
        AddChild(inputManager);
        //Instance the map and set it as a child of the main scene
        camera = cameraScene.Instance();
        ((Node2D)camera).Position = new Vector2(640, 360);
        //Set the camera as the child of the main scene
        AddChild(camera);
        //Set the camera back to the main scene
        CameraEvent cei = new CameraEvent();

        //cei.target = (Node2D)redBlob.GetParent();
        cei.target = (Node2D)this;
        cei.FireEvent();
        //Instance the UI manager and set it as a child of the main scene
        uiManager = uiManagerScene.Instance();
        //Set the UI manager as the child of the main scene
        AddChild(uiManager);
        //Instance the sound manager and set it as a child of the main scene
        soundManager = soundManagerScene.Instance();
        //Set the sound manager as the child of the main scene
        AddChild(soundManager);
        //Create the background and set it as a child of the main scene
        background = backgroundScene.Instance();
        AddChild(background);


        //Instance the fullscreenshader and set it as a child of the main scene
        fullscreenShader = fullscreenShaderScene.Instance();
        //Set the map as the child of the main scene
        AddChild(fullscreenShader);
        SetShaderEvent ssei = new SetShaderEvent();

        ssei.showBlurAndWater = true;
        ssei.FireEvent();

        PlayAudioEvent paei = new PlayAudioEvent();

        paei.musicType = MusicType.MENU;
        paei.FireEvent();
    }