PC Gaming
  Home arrow PC Gaming arrow Page 7 - Improving Input with Joysticks
Dev Hardware Forums 
Computer Cases  
Computer Processors  
Computer Systems  
Digital Cameras  
Flat Panels  
Hardware Guides  
Hardware News  
Input Devices  
Memory  
Mobile Devices  
Motherboards  
Networking Hardware  
Opinions  
PC Cooling  
PC Gaming  
PC Speakers  
Peripherals  
Power Supply Units  
Software  
Sound Cards  
Storage Devices  
Tech Interviews  
User Experiences  
Video Cards  
Mobile Linux 
APP Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PC GAMING

Improving Input with Joysticks
By: Sams Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 13
    2004-09-27

    Table of Contents:
  • Improving Input with Joysticks
  • Calibrating Joysticks
  • Tracking Joystick Movements
  • Revamping the Game Engine for Joysticks
  • Developing the Joystick Code
  • Building the UFO 2 Example
  • Testing the Finished Product

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Improving Input with Joysticks - Testing the Finished Product


    (Page 7 of 7 )

    If you haven't done so already, I encourage you to plug in your joystick and take the UFO 2 program for a test spin. You'll hopefully find that the joystick controls for the program have a surprisingly good feel, considering that the joystick handling code in the program is relatively simple. Try pressing the two primary buttons on the joystick to get a feel for the thrust and hyperspace features of the program. Figure 7.7 shows the flying saucer as it appears with the flaming thrust beneath it.

    morrison

    Figure 7.7 -- The flying saucer in the UFO 2 example shows off its new thrusting capabilities.


    Tip - If the flying saucer immediately starts moving without you touching the joystick, it's a pretty good sign that your joystick needs to be calibrated. Revisit the earlier section "Calibrating Joysticks," to find out how to calibrate your joystick and eliminate this problem.


    Granted, you might have a valid concern as to why the flying saucer visually thrusts but doesn't seem to have any additional lift when you press the thrust button. This is something I challenge you to solve as an exercise on your own; just kick up the vertical speed of the saucer a bit when the thrust button is pressed. You might also have noticed that hyperspace is quite sensitive. In fact, the hyperspace feature reveals how fast the game engine's joystick processing actually is.

    Summary

    Although joysticks don't quite share the widespread acceptance on PCs that keyboards and mouse devices do, they are the quintessential user input device for games. There aren't too many serious gamers who don't have a joystick or game pad. However, you don't have to be serious about games to enjoy the benefits of playing games with a joystick. For this reason and more, it's a good idea to try and support joysticks in games for which it makes sense to use a joystick for input. This chapter gave you the nuts and bolts of Windows joystick handling and even showed you how to build it into the ever-evolving game engine. You also saw how easy it is to add joystick support to an existing program.

    Mark your calendar because Chapter 8, "Example Game: Light Cycles," represents a significant milestone in your game programming career—you develop your first complete action game. Even though the Brainiac game in the previous chapter was technically your first game, moving into the action realm is a huge step forward.

    Field Trip

    I realize that the people at your local computer store might be starting to get suspicious of your repeated trips, but a wealth of knowledge for learning about games can be found there. More specifically, I'd like you return yet again for a joystick reconnaissance mission. In case you haven't noticed, joystick technology has come a long way in recent years. As an aspiring game programming guru, it's important for you to have a solid base of knowledge about what's available in the way of modern joysticks. As you study the different joysticks on the shelves, pay particular attention to the number of buttons and their arrangement. If you already have a game in your mind that you're working on, see if you can figure out how to best make use of the joystick hardware available. Don't forget that it's possible to use only a few joystick buttons for basic game operations and then reserve additional buttons for more advanced features. Game players like to have options, and by intimately understanding the game controller marketplace, you'll be better prepared to provide them with those options.

    SamsThis chapter is from Beginning Game Programming, by Michael Morrison (Sams, ISBN: 0672326590). Check it out at your favorite bookstore today.

    Buy this book now.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · First, I would like to say that a person shouldn't write an article on calibrating...
     

    PC GAMING ARTICLES

    - WoW-ing Online Gamers: What to Expect From t...
    - Age of Conan Review
    - Harnessing Video Game Power for Good
    - Grand Theft Auto IV Review
    - PC Games, a Dying Breed?
    - The Art and Psychology of Gaming
    - Halo 3 Hands On
    - GTA IV: Going Too Far?
    - FEAR Combat Review
    - Prey Review
    - Elder Scrolls IV Oblivion Review
    - PS3: Playing at a Whole New Level
    - F.E.A.R. Video Game Review
    - They Don`t Have to See It to Frag It
    - Do Violent Games Make Violent People?






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT