🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Unlazy Sundays

Published September 27, 1998
Advertisement
Urk, this is one of the first Sundays that I actually don't have a dozen things going on. Whatever happened to lazy Sundays? Anyway, here's the latest.

Got all of the outstanding recently-reported bugs fixed. Got a couple of new ones though, and I'm always adding little features, ensuring that there'll always be new and interesting bugs to fix. Got a clipping bug in Cheesy Pursuit related to the new animation engine. Also got a scroll-bug in the high-score tables, which is a side-effect of using a scrolling browser for the high scores rather than the static tables I used to use. Oh well, bugs come with progress.

Once again, I decided to go against the conventional wisdom and add an ambitious new feature in the eleventh hour. The arcade games now have joystick support! Actually, adding the joystick support was rather simple. I've got a function that wraps up Windows and Mac keyboard-handling that's called from the main game-loop. I just added some new enums for joystick values, and called GetJoyPos() (I think that's the name) from the function.

Of course, such an ambitious addition isn't so simple. In most of my arcade games, the game waits until the user presses a key before the main loop-timer starts up. That way the game waits politely until the user is ready to start moving. I use the traditional keyboard-handler for the opening "pause", which doesn't map nicely to my new function. To fix this, I now have a little opening timer-loop that waits for one of the game keys (or the joystick) to be pressed. It seems to be working, and I've got it in place for all but three of the arcade games. Will probably have it working for the remaining three next week. I'll probably also add some keyboard & joystick default buttons into the Preferences dialog, so folks who wanna play with joysticks just have to click one button rather than redefining all of the "keys" to work with joystick values.

That being said, what's a good threshold for joystick movement? The Windows joystick functions return 0 to 65,535 for the X and Y stick values. I don't need such a range of values, though. Right now, I've basically broken up the range into thirds, so an X-value of 0-20,000 is "left", and 45,535-65,535 is "right". It works just fine, of course, with my joy-pad, but I'm wondering if that's too sensitive or not sensitive enough for those huge analog joysticks. Is there a standard value that most folks prefer? I could make it user-configurable, but I'd rather not. From an ease-of-use perspective, I'd like to just pick a good value and stick with it.

Just to prove that I'm amenable to user-requests, the joystick-control addition was suggested by the woman who cleans our house every other tuesday. Actually, "suggested" isn't a strong enough word. She was downright pissed that she couldn't play StackBlitz with her fancy new joy-pad.
Previous Entry How to fix bugs
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement