this post was submitted on 17 Mar 2024
18 points (100.0% liked)
GameDev
2776 readers
1 users here now
A community about game development.
Rules:
- Adhere to the general lemmy.blahaj.zone rules (#1 being no homophobia, transphobia, racism or other exclusionary content)
- Self-promotion is fine as long as it's not spammy - share your progress, insights, techniques and mishaps! If you recently posted, update the previous post instead of filling the frontpage with your project
- Hide NSFW/NSFL content behind a clear warning, for example: [NSFW Nudity]
More rules might follow if they become necessary; general rule is don't be a pain in the butt. Have fun! ♥
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Accept all inputs. Update on-screen prompts depending on which one was used last.
But be careful with processing those inputs. Team Fortress 2 used to have an exploit where you could move the mouse and tilt a stick and turn twice as fast as you were supposed to be able to.
The way I do it would work well. Treat such vectors as two separate components. Not as X and Y, but Direction and Magnitude. No matter how many ways you can find to break the input, as long as you clamp the magnitude you'll never go faster than intended! This also conveniently solves the √2 problem when moving diagonally.
It's easy. Just check if mouse moves left OR left key is pressed OR joystick is pushed left THEN move left.