Published:03/06/2013 Last Updated:03/06/2013
The availability of Ultrabook and Win 8 Tablets create a new frontier for PC gaming; one that brings touch and sensors inputs to parity with mouse and keyboard. New game genres are appearing that specifically leverage these input methods. The Real-Time Strategy (RTS) genre is one of the PC stalwarts. Though mouse and keyboard are the most precise input mechanisms available, all of the needed actions can be reasonably modeled by touch. This sample is a small RTS game which shows how touch inputs can be added alongside mouse and keyboard inputs for a full device input experience.
The controls summary is presented in the following table
One tap or left mouse button + move |
Pan the view |
Hold two taps + move or mouse wheel |
Zoom In/Zoom Out |
Hold three taps or right mouse button + move |
Select units |
Single tap or left mouse click |
Move command |
Double tap or double left mouse click |
Attack command |
Click/touch on the minimap |
Move the camera to the specified point |
Arrow keys |
Pan the view |
Page Up/Page Down |
Zoom In / Zoom Out |
The screen can be panned using left mouse button or one-tap touch. Minimap in the upper left corner shows the current camera location, object positions and the current view outline. The minimap also enables the user to quickly move the camera to any location by clicking on it with the left mouse button or one-tap touch. Arrow keys can also be used to pan the view.
The scene can be rendered with different zoom levels: from extreme close-up showing all details of every particular unit to strategic views showing almost all the battle scene.
The view can be zoomed in/out using mouse wheel or two-tap touch. Page Up / Page Down keys can also be used.
The sample enables the user to select one or more units using right mouse button or three-tap touch.
All units within the frame get selected. Selected units are marked with blue selection outline:
Selected units can be given move or attack commands. Move command for one or group of selected units is given by single left mouse button click or single touch on the terrain surface. After the command is given, the units start moving towards the designated point following the terrain surface.
Attack command is given with double left mouse click or double touch on the terrain surface point. After that, the selected units start attacking the point. After each explosion, the terrain at the point is slightly deformed and texture is updated.
Units at the point being attack are damaged. Each damage reduces the unit’s health which is indicated in the health bar rendered above the unit. Eventually the unit will be destroyed and explode creating a big hole in terrain surface.
Current command can be cancelled using the Stop button. All units in the scene can be selected using Select All button.
Attachment | Size |
---|---|
touchrts-01.png | 89.7 KB |
touchrts-02-small.png | 615.5 KB |
touchrts-03-small.png | 479.6 KB |
touchrts-04-small.png | 591.8 KB |
touchrts-05-small.png | 593.4 KB |
touchrts-06-small.png | 565.5 KB |
touchrts-07-small.png | 533 KB |
touchrts-source.zip | 24.7 MB |
Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.