Keyboard and mouse controls


There are five main kinds of keyboard controls.

First, there are controls to move the player critter , that is, to change its position, velocity, or orientation.

Second, you can often make the player shoot .

Third, there are controls to change the view location , that is, to move the world relative to your View window.

Fourth, you can reduce or increase the zoom or magnification of the 'lens' through which you view the world.

Fifth, when using 3D graphics, there are controls to change the view direction in which you look at the game.

To summarize let's use the phrase 'direction keys' to include the Arrow keys, the PgUp/PgDn keys and the Home/End keys.

These Controls

Affect This

Direction keys

Player Critter's Motion

Spacebar key

Player Shooting

Ctrl + direction keys

View Location

Ins/Del keys

View Zoom

Ctrl + Shift + direction keys

View Direction (3D Only)

Now for some details.

Player motion controls

The player controls include 2D and 3D controls. The 3D player controls apply only in the three-dimensional game worlds of 3DStub and Defender3D.

In using the player controls, remember to think of the direction the player's sprite points as 'forward.'

The rotations caused by the directional keys speed up if you hold these keys down longer than a fifth of a second. For delicate directional adjustments, just tap on the keys.

Something that complicates the situation is that the user has the option of using the Player menu to change which kind of controls the player uses. The player can use Arrow Key Controls, Scooter Controls, Car Controls, Spaceship Controls, Hopper Controls or Mouse Controls. At present the Hopper Controls selection is only enabled for the Ballworld game.

In describing the controls below, we first specify what the controls do in a 2D world, and then we describe the additional things the controls do in a 3D world.

Arrow key controls

2D: Up/Down arrows move the player up/down along the y -axis. Left/Right move the player left/right along the x -axis.

3D: PgUp/PgDn moves the player forward/backward along the z -axis (which by default points out of the computer screen).

2D & 3D: The Arrow Keys Controls are like classic PacMan. The player moves left, right, up, or down with the arrows, and points in these directions. If someone bumps into the player it will sometimes rotate a little. But normally the player is always aligned with the most recent direction of motion. This makes it hard to shoot in arbitrary directions.

A useful trick in a two-dimensional world is to use the Arrow Key Controls with the Shoot cursor. The Shoot cursor will aim the player and shoot in the direction where you left-click. Using the Shoot cursor makes up for the fact that the Arrow Key Controls always align the critter along the principal axes of the game world. This trick works to a lesser extent in a 3D world, as here the mouse click will always select points in the current plane of the player, and will not produce pitch or roll.

Scooter controls

2D: Up/Down arrows move the player forward/backward. Motion halts as soon as the key is released. Note that reverse motion is possible with the Down arrow. Left/Right yaws the player left or right.

3D: PgUp/PgDn pitch the player's tip up or down. Home/End rolls the player counterclockwise/clockwise around its direction of motion.

Car controls

2D: Up arrow accelerates the player forward up to a maximum speed. Player cruises along at the same speed until you slow it down. The Down arrow acts as a brake that can slow the player's speed down to zero. There is no 'reverse gear.' The Left/Right arrows yaw the player left or right, instantly changing its direction of motion.

3D: PgUp/PgDn pitch the player's tip up or down. Home/End rolls the player counterclockwise/clockwise around its direction of motion.

2D & 3D: You can think of Car Controls as Scooter Controls plus momentum. In Car Controls motion, you use Up/Down like accelerator/brake and use Left/Right , PgUp/PgDn , Home/End like a steering wheel.

Spaceship controls

2D only: with Spaceship Controls, the player's sprite doesn't have to point in the same direction as the player's motion. The Up key accelerates the player in the direction in which the sprite is pointing. The Down key gives the player a reverse acceleration, in the direction opposite to which it's pointing. If held down long enough, the Down key can make the player begin moving in reverse. The Left/Right keys rotate the player to the left and right.

Hopper controls

2D: the Hopper Controls move the player left and right with the Left and Right arrow keys. The Up arrow key hops the player up into the air, but continuing to depress the Up key will not produce a continued hopping effect. You need to tap the Up key repeatedly if you want to add a hop to a hop.

3D: PgUp/PgDn moves the player forward/backward along the z -axis (which by default points out of the computer screen).

Mouse controls

2D: the player effectively becomes the Mouse cursor and moves freely with the mouse. If you move the mouse outside of the game world, the current cursor icon reappears and the player 'waits' at the edge of the game world. The Left/Right arrow keys can also rotate the player.

3D: in a 3D world such as 3DStub, the mouse moves the player within the current plane of the player's sprite . You can use the PgUp/PgDn keys to pitch the player's attitude up or down, and the Home/End keys to roll the player counter-clockwise/clockwise.

2D & 3D: When moving the player with the Mouse Controls, the player's velocity matches the current velocity of the mouse motions . This means you can use the Mouse Controls to hit things with the player as if the player were a paddle. This feature is important for the Airhockey game.

Note that when the Player Mouse Controls is being used, the cursor tools are disabled.

Player shooting controls

2D & 3D: The spacebar lets the player critter shoot bullets in the direction in which the player sprite is pointing. For realism , any forward component of the player's own motion in the shooting direction is added to the bullet motion. In 3D, the Pop Framework orients the bullets to have the same pitch, roll, and yaw as the shooter. Bullets are shot as long as the spacebar is held down.

In the case where the Shoot cursor is selected, the left mouse button or the Z key will also shoot. In addition, the left-click or Z key will aim the player in the direction of the current mouse position before shooting. Using the Shoot cursor you can fire at targets simply by left-clicking or Z -keying on them.

The Z key option has two purposes. First, it can be more ergonomic to use the Z key in place of the left mouse button. Second, you may need the Z key option if you have reassigned the meanings of the buttons on your tracking device, as in this case the Pop program may not recognize your current 'left button.'

A useful player control combination in a two-dimensional world is to use the Arrow Key Controls with the Shoot cursor. Using the Shoot cursor makes up for the fact that the Arrow Key Controls always align the critter along the principal axes of the game world. The Shoot cursor allows you to aim and shoot in any direction you like.

Standard view controls

The view controls include 2D and 3D controls, where the 3D controls apply if you are using 3D graphics such as View 3D OpenGL Graphics . Unlike the player-controlling keys, the view key controls are not sensitive to how long the keys have been held down.

View location controls

2D or 3D: Ctrl+Up/Down arrow keys move the world up/down. Up slides the world up, Down slides it down. Ctrl+Left/Right arrow keys move the world left/right. Left slides it left, Right slides it right.

3D only: PgUp/PgDn move the world closer/further, that is, PgUp/PgDn move the viewpoint forward/ backwards .

View direction

3D only: Ctrl+Shift+Left/Right yaws the world left/right. Ctrl+Shift+Up/Down pitches the world up/down. As with the View Location controls, Ctrl+Shift+Left swings the world to the left, Ctrl+Shift+Right swings the world to the right, and so on.

Ctrl+Shift+Home/End rolls the world counterclockwise/clockwise.

View zoom control

2D and 3D: Ins/Del magnify or shrink the image. The Zoom Controls change the field of view without changing the view position. You can think of them as smoothly transforming from a telephoto to a wide-angle lens. There are limits to how far in and out you can zoom.

To restore to a normal zoom, use View Reset Viewpoint or the Ctrl+R shortcut.

View controls using Ride the Player

You can only choose the Ride the Player option in the 3D OpenGL view.

3D Only: when the V iew Ride the Player option is selected, the viewpoint and view direction are controlled by the motions of the player critter. The viewpoint is perched upon a ' saddle ' a bit behind and above the player, and the view direction is set to look out ahead of the player. When the View Ride the Player option is in effect, the Ctrl+Up/Down keys affect the height above the player which the viewer rides.

When you Ride the Player, the View Direction controls have no effect. Instead, you change the view direction by turning the player. The Ins and Del keys still affect the zoom of the view.

A hardware Windows bug in the Arrowkey Controls

Unfortunately the combination of the standard Windows keyboard and Windows operating system has a minor bug that we can't seem to work around. This occurs when you use the Spacebar along with the small group of four Arrow keys that sits between the alphabetical keys and the rectangular block of numerical keys. We refer to the group of Arrow keys arranged like this near the bottom edge of the keyboard:

 

Up

 

Left

Down

Right

You cannot get this Left key, the Space key and any other of these Arrow keys to work at the same time. Barring a fix from Microsoft, the only way around this at present is to use the Arrow keys on the digital key pad to the right side of your keyboard, making sure that the Num Lock is off, so that these keys act like Arrow keys.



Software Engineering and Computer Games
Software Engineering and Computer Games
ISBN: B00406LVDU
EAN: N/A
Year: 2002
Pages: 272

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net