-
Notifications
You must be signed in to change notification settings - Fork 33
The Example Unity Project
The example project provided in the repo demonstrates the capabilities of XboxCtrlrInput
. The demo project requires Unity 4.3 or above because it makes use of features that became free in Unity 4.2, including text serialization and shadow rendering. It's located in the /XboxCtrlrInput
folder, so when opening the project from Unity, select this folder.
The demo includes a scene with four players that are programmatically colored by their player number. Player 1 is red, Player 2 is green, Player 3 is blue, and Player 4 is yellow. They all use the same script MovePlayer.cs
, which uses XboxCtrlrInput
to get Xbox controller input. If any player falls off the platform, the level will restart. Players can fire different kinds of bullets depending on what buttons are pressed.
It must be noted that this demo has no real gameplay in it. It solely demonstrates XboxCtrlrInput
as an interactive tech demo. For example, bullets don't do anything except travel in a straight line for usually 3 seconds before getting destroyed.
Use the left stick to move the player quickly. Use the right stick to move the player slowly (3/10ths the speed).
Press the left stick to jump. Press the right stick to slam towards the ground.
Each player has two "ears" that get short when pressing down the triggers. Each trigger corresponds to an "ear". Releasing the triggers returns the ears to the original lengths.
Pressing the bumpers will shoot long black bullets out of the corresponding "ears" of the player. These bullets should be going upwards.
Pressing the Start and Back buttons should shoot black bullets out of the "ears" of the player just like the bumper buttons, except these bullets should be tiny. The Back button shoots from the left ear and the Start button shoots from the right ear.
Pressing on a D-Pad should shoot long black bullets that travel in the corresponding direction. For example, pressing right on the D-Pad should spawn a bullet going right.
The A, B, X, and Y buttons (i.e. the colored buttons) should shoot colored bullets that correspond to the button's color and direction on the controller. For example, Pressing the B button should spawn a red bullet going right. The picture below shows what happens when you press A.