-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
42 lines (33 loc) · 1.15 KB
/
Program.cs
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
using GpioHat;
using System;
using System.Threading;
namespace Tamon_Testat {
public class Program {
public static JoystickButtons Butt = JoystickButtons.None;
static void Main( string[] args ) {
Game game = new Game();
#region Wait for Debugger
if ( args.Length > 0 && args[ 0 ] == "--debug" ) {
Console.WriteLine( "Waiting for debugger ..." );
while ( !System.Diagnostics.Debugger.IsAttached ) {
System.Threading.Thread.Sleep( 500 );
}
}
#endregion
Raspberry raspi = Raspberry.Instance;
raspi.Joystick.JoystickChanged += JoystickChangedCallback;
Console.WriteLine( "Welcome to TAMON" );
Thread.Sleep( 1000 );
Console.Clear();
// RUN() hier
game.Run();
// debugg
Console.ReadKey();
}
private static void JoystickChangedCallback( object sender, JoystickEventsArgs e ) {
if ( e.Buttons != JoystickButtons.None ) {
Butt = e.Buttons;
}
}
}
}