summaryrefslogtreecommitdiff
path: root/scripts/Game.cs
blob: 8de7af6c72715b2f5092e9d9616e7eba146ae329 (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
27
28
using Godot;
using System;

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

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

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

		inputHandler = GetNode<InputHandler>("InputHandler");
		Dungeon = map.buildingLayer;

		player = map.player;
	}

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

		Action action = inputHandler.GetAction();

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