Initial commit, reusable code for my nvgt based games.

This commit is contained in:
Storm Dragon
2026-02-16 19:49:29 -05:00
commit 65370b4679
16 changed files with 1735 additions and 0 deletions

30
multikey.nvgt Normal file
View File

@@ -0,0 +1,30 @@
// Multikey input helpers.
bool check_key_down(array<int>@ keys) {
// True when at least one key in the set is currently down.
if (keys is null || keys.length() == 0) {
return false;
}
for (uint keyIndex = 0; keyIndex < keys.length(); keyIndex++) {
if (key_down(keys[keyIndex])) {
return true;
}
}
return false;
}
bool check_all_keys(array<int>@ keys) {
// True only when every key in the set is currently down.
if (keys is null || keys.length() == 0) {
return false;
}
for (uint keyIndex = 0; keyIndex < keys.length(); keyIndex++) {
if (!key_down(keys[keyIndex])) {
return false;
}
}
return true;
}