Original Challenge: *FAST* Joystick Library for QB!! ;*) ! - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: QbasicNews.Com (http://qbasicnews.com/newforum/forum-3.html) +--- Forum: Challenges (http://qbasicnews.com/newforum/forum-10.html) +--- Thread: Original Challenge: *FAST* Joystick Library for QB!! ;*) ! (/thread-1801.html) |
Original Challenge: *FAST* Joystick Library for QB!! ;*) ! - Adigun A. Polack - 08-23-2003 Dearest ***WORTHY*** QB45/QB71 community, Hello there and WELCOME!!! ! Just currently today, I was already working on adding some **HOT**, smooth-controlling joystick routines to the game Frantic Journey (FJ). Iâve tested the ORIGINAL QuickBASIC joystick routines for one of my programs, and the whole operation of the program SLOWED down (even though the routines did work properly). And, Iâve tried DirectQBâs own joystick routines for FJ, and the result there was that some of the controls there were _absolutely_ jerky, making the game a pain to play using those joystick routines (which was WHY I had to just throw them out of the project for good! ! ), even though they did not slow the game down at all. And that, my friends, brings me to my next original challenge which is this: Create the FASTEST AND MOST RESPONSIVE joystick library for QuickBASIC as _accurately_ as possible!! :king: !! Here are the rules:
Entries that fail to follow either of the seven (7) steps *WILL* be disqualified. PERIOD. With all of that in mind, DO YOUR RATHER SPLENDID BEST!!! !! WISHING YOU SUCH ***EXCELLENT*** GOOD FORTUNE, Adigun Azikiwe Polack One of the Founders of âAura Flowâ Webmaster of the AAP Official Homepage Official Founder of the âQuickBASIC Caliber Programming Compoâ not an entry for this challenge, but... - Meg - 08-23-2003 ...reading Mr. Polack's posts always makes me feel like some very special ambassador for an important country or something. I just want to stand up proud! :king: :bounce: :lol: *peace* Meg. Original Challenge: *FAST* Joystick Library for QB!! ;*) ! - pr0gger - 08-23-2003 Now if only I had a joystick.... Oh well. Good stuff comes out of challanges, like the 1 hour compo. :bounce: ... Meg... you're in Maryland? :o Original Challenge: *FAST* Joystick Library for QB!! ;*) ! - Plasma - 08-23-2003 Sounds to me like you just want someone to do your work for you...anyhow, reading the joystick is a piece cake. Here's part of the code I wrote for my MP3 player (it used a gameport interface): Code: OUT &H201, 0 Now obviously you'd want some kind of dead-zone...again, this is very easy to implement: First you calibrate the joystick. Read AxisX and AxisY when the stick is centered. Then compute the dead-zone: Code: DeadX = AxisX * 2 / 3 To determine the gamepad direction after you have the dead-zone settings, just use: Code: BtnLeft = AxisX < DeadMinX You could port this to assembly, but there's no point. The speed limitation here is the joystick hardware, not the code. (Thus making your rule #4 impossible. Hint - don't poll the joystick every time you update the screen...) ooh nice - Meg - 08-23-2003 Plasma: Cool. I didnt know how to use the joystick. Looks pretty nice and simple. Thanks, Plasma! Pr0gger: yes, I'm in Maryland. I went to school here (at UMD). Recently graduated. Go Terps! *peace* Meg. p.s. I don't wanna put my age next to my location. :-p I'm 22. Original Challenge: *FAST* Joystick Library for QB!! ;*) ! - Piptol - 08-23-2003 Quote:Hint - don't poll the joystick every time you update the screen...)Darn, why didn't I think of that... I could have put 3 players in Squealer TNT after all.. How did commercial DOS games get around the slowness of the joystick hardware in 'the olden days'? Original Challenge: *FAST* Joystick Library for QB!! ;*) ! - Plasma - 08-23-2003 The joystick is the same speed now as it was in the "olden days" You still have to wait for the pot countdown. With faster computers, you're just wasting more cycles... Creating a *FAST* joystick lib sure ainât easy, BUT......... - Adigun A. Polack - 08-23-2003 To Piptol and Plasma357, Now, I know it is not even easy creating a *FAST* joystick library for QB, but really, it has been done with DirectQB to where it got around the slowdown problems, which was _VERY_ fortunate, to be downright honest with you (remember that one?). Also, such good-olâ MS-DOS games, like Cash Invaders for instance (the analogue controls on my gamepad worked GREAT for that game, believe it or not!), have done the exact same thing, as well. And, according to rule #1 of my current challenge, other than QB, you are *allowed* to create your own joystick code through some other programming language as C, C++, Assembler, and/or Visual Basic for Windows. Or, if you prefer, you can make your **fastest** joystick library that actually interfaces from Windows (using DirectX Joystick support for a WIDE variety of current controllers!!) directly to QuickBASIC, just like both DS4QB2 and DS4QB++ did for music and sound. Now thereâs both an idea and a challenge for âya, huh? Again, it sure ainât easy to create, but it **CAN** be mastered successfully with at least some wise thinking on tap!! ! By the way, I do have both a 9-button PC gamepad and a 10-button PC gamepad, just to get you all thinking here. I am just helping you look into something really REVOLUTIONARY and MIND-BLOWING for QB where joystick/gamepad routines are concerned. If nothing else here, at very least I am giving you some cool ideas on this, okay? Again, I thank you so much for your wonderful time. HELPING YOU TO DELVE DEEP INTO THE FUTURE OF QB JOYSTICK/GAMEPAD LIBS, Adigun Azikiwe Polack One of the Founders of âAura Flowâ Webmaster of the AAP Official Homepage Official Founder of the âQuickBASIC Caliber Programming Compoâ Original Challenge: *FAST* Joystick Library for QB!! ;*) ! - Plasma - 08-23-2003 I don't think you understand how a joystick works. The x and y axis values are based on TIMING. The TIME is the same no matter which language you use. Try it yourself. Original Challenge: *FAST* Joystick Library for QB!! ;*) ! - toonski84 - 08-23-2003 I know joysticks on other machines, and stuff like NES gamepads are controlled by timer frequency, but there's 9 pins on the game port, and I always thought that they light up to different joystick directions and stuff. But hey, I dont know much about hte things either. Just make it keyboard support and be happy with it, dammit... |