forked from janholo/ProgrammingChallenge1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
52 lines (44 loc) · 1.34 KB
/
Program.cs
File metadata and controls
52 lines (44 loc) · 1.34 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using ConsolePong.GameLogic;
using ConsolePong.View;
using System;
using System.Numerics;
namespace ConsolePong
{
internal class Program
{
static void Main()
{
Console.Clear();
Console.CursorVisible = false;
try
{
Run();
}
finally
{
Console.CursorVisible = true;
}
}
private static void Run()
{
Console.WriteLine("Resize your terminal and press any key if you are ready!");
Console.ReadKey();
var gameSettings = new GameSettings(
new Vector2(18.0f, 10.0f),
60.0f,
1.0f,
0.1f,
0.2f,
new Vector2(0.2f, 0.5f),
4.0f
);
var consoleView = new ConsoleView(gameSettings);
var runner = new GameRunner();
var leftController = new Controller.JanReinhardt.NaiveController();
var rightController = new Controller.JanReinhardt.NaiveController();
runner.Run(gameSettings, consoleView, leftController, rightController);
Console.WriteLine("Press any key to exit:");
Console.ReadKey();
}
}
}