GlovePIE:Wiimote Object

From WiiLi

Jump to: navigation, search
Here is my Wiimote Object script for GlovePIE.

/* A Hylian Human's Wiimote Object Script
Version 1 */

/* Instructions:

Moving Cube:

X position (Left, Right) Nunchuk Joystick Left, Right
Y position (Up, Down) Nunchuk Joystick Up, Down
Z position (Out, In) Nunchuk C, Z

Changing Size: Plus and Minus

Changing Color: change the values below using RGB: [13%, 57%, 13%]
or Hexadecimal: 0x0D390D  */

var.CubeColor = 0x0D390D
var.BgColor = 0x000000

/* To Control Positon */

// Y axis
if(1.2 > wiimote.Nunchuk.JoyY > 0.5)
obj1.y = obj1.y - .1
endif

if(-1.2 < wiimote.Nunchuk.JoyY < -0.5)
obj1.y = obj1.y + .1
endif

// X axis
if(-1.2 < wiimote.Nunchuk.JoyX < -0.5)
obj1.x = obj1.x - .1
endif

if(1.2 > wiimote.Nunchuk.JoyX > 0.5)
obj1.x = obj1.x + .1
endif

// Z axis
if Wiimote.Nunchuk.CButton = True
obj1.z = obj1.z + .1
endif

if Wiimote.Nunchuk.ZButton = True
obj1.z = obj1.z - .1
endif

/* To Control Size */
if Wiimote.Plus = True
obj1.CubeSize = obj1.CubeSize + .1
endif

if Wiimote.Minus = True
obj1.CubeSize = obj1.CubeSize - .1
endif

/* Color */

// Cube Color
obj1.colour = var.CubeColor

// Background Color
Cam.BgColour = var.BgColor

/* Resetting Values */

// Position
if Wiimote.Up = True
obj1.z = 0
endif

if Wiimote.Right = True
obj1.y = 0
endif

if Wiimote.Left = True
obj1.x = 0
endif

if Wiimote.Down = True
obj1.CubeSize = 1
endif

if Wiimote.B && Wiimote.DPad = True
obj1.pos = 0;
obj1.CubeSize = 1
endif

Personal tools
Online Casino - best online casino reviews.
Facebook Developers - facebook applications, facebook developers, facebook development, social network application development and viral widget social media strategy