Computer Games for Learning Joystick Control

Designers: Pinata Hungspreugs and Becky Poon

Client Coordinators: Robbin Newton

Supervising Professor: Dr. Larry N. Bohs

Two joystick controlled computer games, “Catch the Butterfly” and “Bump & Go”, have been developed to train children to use powered wheelchairs. Compared to other wheelchair trainers currently available, these games are more fun to play and also provide feedback concerning the child’s progress to the therapist. The software can be distributed to enable the child to practice at the hospital with the therapist, or at home under a parent’s supervision.

How this project helped
Since most powered wheelchairs use joystick control, children need to learn how to operate a joystick prior to trying a powered wheelchair. “Catch the Butterfly” and “Bump & Go” help improve joystick skills because they are fun to play and motivate the child to do better. In addition, the statistical data is used to evaluate whether a child has a weakness in stopping or in moving in a certain direction. The games are currently being used by therapists at Lenox Baker Children’s Hospital.  The computer games are written in Visual Basic 5.0 for IBM compatible computers. These games require a Windows 95 operating system, 4 MB free hard drive space, and a sound card with joystick port.

“Catch the Butterfly” helps beginners and younger children become adjusted to using a joystick. In this game, the child moves a boy holding a net around the screen to catch a butterfly. To encourage the child, a reward screen containing visual and audio stimuli is shown each time a butterfly is caught. The game contains three levels of difficulty. In the first level, the butterfly remains stationary to allow the child to learn how to handle the joystick. In the second level the butterfly flies around the screen. This allows the child to practice following an object and moving the joystick in different directions. The third level contains a bee (see Figure 1) which the child must avoid while attempting to catch the butterfly. If the boy is “stung” he is moved further away from the butterfly.

“Bump & Go” is a more challenging game that acquires statistical feedback on the progress of the child. There are four levels of increasing difficulty. Each level consists of a car that the player must move with the joystick to reach his or her “destination,” an image that appears in random positions on the screen. The player drives the car from the starting point in middle of the screen to the destination. Walls act as barriers between the car and the destination, except in the first level. With increasing levels, the number of walls increases and the size of the openings between them decreases. Though the images appear randomly, they are placed in specific areas of the screen. This allows the therapist to determine if the child is having trouble moving the joystick in a particular direction. “Bump & Go” also contains a stop sign function that records the amount of time it takes for the child to stop moving. A timer also records how long it takes for the car to reach each destination. This information is saved in a file to allow the therapist to evaluate whether the child is having difficulty moving in a particular direction.

A scoring system is implemented in “Bump and Go” in order to motivate the child. The final score is controlled by the amount of time the child requires to reach the destination image and by the number of objects the child hits during the game.

Each object in the games is a represented by a bitmap image. Its position in the game field is given by the object’s x and y coordinates with respect to the upper-left corner of the field (0,0). Visual Basic 5.0 automatically calculates many properties of the object in the program including the height, width, and coordinates of the top, bottom, right, and left edges of the image. To make the game more entertaining for the child, we used colorful animated images (e.g. the boy in “Catch the Butterfly” runs around the screen.) This requires a series of images, each slightly different, which create the effect of movement when rapidly alternated (i.e. like a flipbook.) Joystick control is given to the characters using the program joystick.exe from Mabry Software (Stanwood, WA), which returns the x and y coordinates of the joystick. These values are used to position the image on the screen. When the joystick moves a certain distance in one direction the function Joystick1_Move is activated and moves the object (the car or the boy with the net) in the direction the joystick is pushed. The distance the image moves can be increased or decreased by changing the number of pixels the image shifts when the function is read. The program also makes sure that the image does not move off the screen by comparing the coordinates of the image to those of the screen.

The games must be able to identify collisions between two images on the screen. The functions Collided, HitUpDown, HitLeftRight, and LtRtShort detect the collision of two objects. Collided obtains the coordinates of the right, bottom corner of two bitmaps which are then passed to the Windows API function called IntersectRect. This function will return 0 if the two images do not overlap. If they do overlap, IntersectRect returns a 1. This invokes the reward screen which is controlled by the function Timer2. Collided is used in “Catch the Butterfly.” To detect collisions between the car and walls or destinations in “Bump & Go,” the functions HitUpDown, HitLeftRight, and LtRtShort are used. In these functions, the coordinates of the car are compared to each object on the screen by a series of If – Then statements to see if they are touching each other. If the car touches a block, the position of the car changes so it “bounces” back from the wall. If the car touches a destination point, Timer2 is invoked and the reward screen appears.

A function was written to record the time it takes for the child to move the car from the starting point to the final destination. When the car appears on the screen, the command Timer, which captures the time of day in seconds, is called and is saved as Start. Timer is then called when the child reaches the destination image and the time is saved as Finish. The difference between Finish and Start is used to determine the average time required to reach each destination on the screen. This information is then written to a file specified by the therapist if he/she chooses to record the data.

Though the games are in good working condition and satisfy our objectives, there are several components that could improve the project. Improvements could be made on the feedback information for the therapist and time analysis. One way that this could be done would be to take the speed of the car into account. If the car is set to a higher speed, the car will reach the destination quicker, and the average time might not be a good indicator of performance. It may be useful to implement a function that averages speed and time to create a performance gauge. This could be coupled with an evaluation screen that would give suggestions to the therapist on what the child should work on and if they are ready to play a more difficult level.

The total cost of this project was $195, including the cost of the joystick and sound card for the PC.

Comments are closed.