From ba26a7686c3fa247c0b0659b404f6087b2bd63d5 Mon Sep 17 00:00:00 2001 From: ZacharyPatten Date: Sat, 30 Sep 2023 09:02:22 -0500 Subject: [PATCH] shmup web control improvements --- Projects/Website/Games/Shmup/Shmup.cs | 14 ++++++++++++++ Projects/Website/Pages/Shmup.razor | 16 ++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Projects/Website/Games/Shmup/Shmup.cs b/Projects/Website/Games/Shmup/Shmup.cs index c6b5aed5..24594c46 100644 --- a/Projects/Website/Games/Shmup/Shmup.cs +++ b/Projects/Website/Games/Shmup/Shmup.cs @@ -53,6 +53,13 @@ public class Shmup internal static bool spacebar_down = false; + internal static bool ui_u_down = false; + internal static bool ui_d_down = false; + internal static bool ui_l_down = false; + internal static bool ui_r_down = false; + + internal static bool ui_shoot_down = false; + public async Task Run() { if (OperatingSystem.IsWindows() && (consoleWidth < intendedMinConsoleWidth || consoleHeight < intendedMinConsoleHeight)) @@ -149,8 +156,15 @@ async Task Update() d = d || downarrow_down; r = r || rightarrow_down; + u = u || ui_u_down; + l = l || ui_l_down; + d = d || ui_d_down; + r = r || ui_r_down; + shoot = shoot || spacebar_down; + shoot = shoot || ui_shoot_down; + if (waitingForInput) { waitingForInput = !(u || d || l || r || shoot); diff --git a/Projects/Website/Pages/Shmup.razor b/Projects/Website/Pages/Shmup.razor index 829b3523..30193bf4 100644 --- a/Projects/Website/Pages/Shmup.razor +++ b/Projects/Website/Pages/Shmup.razor @@ -21,16 +21,12 @@
- - - - - - - - - - + + + + + +