33 lines
761 B
C#
33 lines
761 B
C#
using Godot;
|
|
using System;
|
|
|
|
public partial class Main : Node
|
|
{
|
|
public Battle _currentBattle;
|
|
public PlayerManager _player;
|
|
public ComputerManager _computer;
|
|
|
|
public override void _Ready()
|
|
{
|
|
Globals.Instance._screenSize = GetViewport().GetVisibleRect().Size;
|
|
Globals.Instance._screenCenter = new Vector2(Globals.Instance._screenSize.X / 2, Globals.Instance._screenSize.Y / 2);
|
|
|
|
_currentBattle = GetNode<Battle>("Battle");
|
|
_player = GetNode<PlayerManager>("Player");
|
|
_computer = GetNode<ComputerManager>("Computer");
|
|
|
|
_currentBattle.Start(_player, _computer);
|
|
_player.Start();
|
|
_computer.Start();
|
|
}
|
|
|
|
public override void _Process(double DELTA_)
|
|
{
|
|
if (Input.IsActionJustReleased("quit_game"))
|
|
{
|
|
GetTree().Quit();
|
|
}
|
|
}
|
|
|
|
}
|