Created
June 13, 2025 12:40
-
-
Save nathonius/4a49dcf3887ee13da87bf9580e6046b0 to your computer and use it in GitHub Desktop.
GZDoom SPINNY keys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version "4.12.2" | |
class SpinnyKeyHandler : EventHandler | |
{ | |
Array<Key> knownKeys; | |
override void WorldThingSpawned(worldEvent e) | |
{ | |
// Try casting the spawned actor as the Key class: | |
let k = Key(e.thing); | |
// If the cast succeeded, this means this actor | |
// is based on the Key class, i.e. is a key: | |
if (k) | |
{ | |
knownKeys.Push(k); | |
k.bWALLSPRITE = true; | |
k.bFLOATBOB = true; | |
k.FloatBobStrength = 1.0; | |
} | |
} | |
override void WorldTick() | |
{ | |
// SPIN TO WIN | |
for(int i = 0; i < knownKeys.Size(); i++) | |
{ | |
knownKeys[i].A_SetAngle(knownKeys[i].angle+5.0, SPF_INTERPOLATE); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment