static void InitializeVariables() { Config cfg = new Config(); new MainFunctions().ConsoleWrite("[GDMP Log] -> Waiting for Geometry Dash...", ConsoleColor.White); while (Config.iGDWindow == IntPtr.Zero) { Config.iGDWindow = GDNative.FindWindow(default(string), "Geometry Dash"); } Console.Clear(); }
void thread_KeyPressDetection() { while (true) { short P1state = GDNative.GetAsyncKeyState(Keys.LButton); short P2state = GDNative.GetAsyncKeyState(Keys.Up); if (iType == (int)Config.Types.TCP_HOST) { if (P1state == -32767) { P2Jump = true; } } else if (iType == (int)Config.Types.TCP_CLIENT) { if (P2state == -32767) { P1Jump = true; } } } }
public void PlayerJump(int PlayerNum) { //Player1(SPACEBAR/MOUSECLICK) = 1, Player2(UPARROW) = 2; switch (PlayerNum) { case 1: //Player 1(SPACEBAR) GDNative.SendMessage(Config.iGDWindow, (uint)GDNative.WM.WM_KEYDOWN, (IntPtr)GDNative.VK.VK_SPACE, IntPtr.Zero); Thread.Sleep(200); GDNative.SendMessage(Config.iGDWindow, (uint)GDNative.WM.WM_KEYUP, (IntPtr)GDNative.VK.VK_SPACE, IntPtr.Zero); break; case 2: //Player 2(UPARROW) GDNative.SendMessage(Config.iGDWindow, (uint)GDNative.WM.WM_KEYDOWN, (IntPtr)GDNative.VK.VK_UP, IntPtr.Zero); Thread.Sleep(200); GDNative.SendMessage(Config.iGDWindow, (uint)GDNative.WM.WM_KEYUP, (IntPtr)GDNative.VK.VK_UP, IntPtr.Zero); break; } }