summaryrefslogtreecommitdiff
path: root/scripts/Game.cs
blob: ddea39536bbfafc6b39ca9f8e78ce285c72288aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using Godot;
using System;

public partial class Game : Node {
	private Player player;
	public DungeonLevel Map { get; private set; }
	private InputHandler inputHandler;

	public override void _Ready() {
		base._Ready();

		Map = GetNode<DungeonLevel>("Map");

		inputHandler = GetNode<InputHandler>("InputHandler");
		
		player = Map.player;
	}

	public override void _PhysicsProcess(double delta) {
		base._PhysicsProcess(delta);

		Action action = inputHandler.GetAction();

		action?.Perform(this, player);
	}
}