Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

The Example Unity Project

Jibran Syed edited this page Jan 15, 2014 · 11 revisions

<- Back to the Wiki

Intro

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.

ExampleDemoScreenshot

Contents

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.

Functionality

Tilting the Left and Right Sticks

Use the left stick to move the player quickly. Use the right stick to move the player slowly (3/10ths the speed).

Pressing the Left and Right Sticks

Press the left stick to jump. Press the right stick to slam towards the ground.

jumpScreen

Triggers

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.

triggerScreen

Bumpers

Pressing the bumpers will shoot long black bullets out of the corresponding "ears" of the player. These bullets should be going upwards.

bumperScreen

Start and Back Buttons

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.

startBackScreen

D-Pad

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.

dpadScreen

A, B, X, and Y

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.

abxyScreen

<- Back to the Wiki

Clone this wiki locally