Ejemplo n.º 1
0
    public override void _Ready()
    {
        _sidebar        = (RichTextLabel)GetNode("CanvasLayer/Sidebar/Text");
        _deityPopup     = (DeityPopup)GetNode("CanvasLayer/DeityPopup");
        _characterPopup = (CharacterPopup)GetNode("CanvasLayer/CharacterPopup");
        _helpPopup      = (HelpPopup)GetNode("CanvasLayer/HelpPopup");
        _alterPopup     = (AlterPopup)GetNode("CanvasLayer/AlterPopup");
        _messagePopup   = (MessagesPopup)GetNode("CanvasLayer/MessagesPopup");
        _retryPopup     = (Control)GetNode("CanvasLayer/RetryPopup");

        _camera = (Camera2D)GetNode("Camera2D");

        var catalog = new Catalog();

        _level = (Level)GetNode("Level");
        _level.Setup(catalog, 32, 32);

        Globals.OnEventCallbacks.Add(OnEvent);

        _player = Globals.Player ?? catalog.NewPlayer(3, 4);
        _player.Messages.Add("[color=#ccffff][b]Welcome![/b] You may want to press [?] for help or [tab] to see the current deities.[/color]");

        _level.Add(_player);
        RemoveChild(_camera);
        _player.AddChild(_camera);

        PopulateLevel();
    }
Ejemplo n.º 2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }