Exemplo n.º 1
0
 // Called when the node enters the scene tree for the first time.
 public override void _Ready()
 {
     UIInputEvent.RegisterListener(GetUIInput);
     CellConvertEvent.RegisterListener(CellConverted);
     DeathEvent.RegisterListener(OnDeathEvent);
     //Load all the needed scenes for the games start
     LoadScenes();
     InstatiateScenes();
 }
Exemplo n.º 2
0
    //=================================================================================================================

    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        //The events from the UI
        GetUIEvent.RegisterListener(GetUIInput);
        //Regestiring the events for the game states
        RunEvent.RegisterListener(RunPressed);
        WinEvent.RegisterListener(WinGame);
        DeathEvent.RegisterListener(LoseGame);

        Load();
        Init();
    }
Exemplo n.º 3
0
 public override void _Ready()
 {
     WinEvent.RegisterListener(ShowWinScreen);
     DeathEvent.RegisterListener(ShowDeathScreen);
     //Grab a refference to all the ui screens for hte game
     ui          = GetNode <Node2D>("UI");
     menu        = GetNode <Node2D>("Menu");
     winScreen   = GetNode <Node2D>("WinScreen");
     DeathScreen = GetNode <Node2D>("DeathScreen");
     //Hide all the screens for the game
     HideAll();
     //Show the menu screen at startup
     ShowMenu();
 }
Exemplo n.º 4
0
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        //Pre load the scenes for the game
        playerScene   = ResourceLoader.Load("res://Scenes/Player.tscn") as PackedScene;
        mapScene      = ResourceLoader.Load("res://Scenes/Map.tscn") as PackedScene;
        enemyScene    = ResourceLoader.Load("res://Scenes/Enemy.tscn") as PackedScene;
        artifactScene = ResourceLoader.Load("res://Scenes/Artifact.tscn") as PackedScene;
        uiScene       = ResourceLoader.Load("res://Scenes/UI.tscn") as PackedScene;
        //The UI of the game
        ui = uiScene.Instance();
        AddChild(ui);

        SendUIEvent.RegisterListener(StartGame);
        DeathEvent.RegisterListener(LoseGame);
        WinEvent.RegisterListener(WinGame);
    }
Exemplo n.º 5
0
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        PlayAudioEvent.RegisterListener(PlayAudio);
        DeathEvent.RegisterListener(OnDeathEvent);
        //Create the audio stream players and add them as children tot the sound manager
        soundEffects.Name     = "SoundEffects";
        soundEffects.VolumeDb = -30;
        AddChild(soundEffects);
        music.Name     = "Music";
        music.VolumeDb = -30;
        AddChild(music);
        //Load a few audio samples
        soundEffectsList.Add(ResourceLoader.Load("res://Sounds/Effects/impactsplat.wav") as AudioStream);
        soundEffectsList.Add(ResourceLoader.Load("res://Sounds/Effects/ButtonClick.wav") as AudioStream);

        musicList.Add(ResourceLoader.Load("res://Sounds/Music/the_kings_forgotten_medallion.ogg") as AudioStream);
    }
Exemplo n.º 6
0
 // Called when the node enters the scene tree for the first time.
 public override void _Ready()
 {
     DeathEvent.RegisterListener(PlayerDeath);
 }