GlovePIE:Super Smash Bros. - 2 in 1

From WiiLi

Jump to: navigation, search
//____________________________________________________________________________//
//                 _________                                                  //
//                /   _____/ __ __ ______    ____ _______                     //
//                \_____  \ |  |  \\____ \ _/ __ \\_  __ \                    //
//                /        \|  |  /|  |_> >\  ___/ |  | \/                    //
//               /_______  /|____/ |   __/  \___  >|__|                       //
//                       \/        |__|         \/                            //
//               _________                         .__                        //
//              /   _____/  _____  _____     ______|  |__                     //
//              \_____  \  /     \ \__  \   /  ___/|  |  \                    //
//              /        \|  Y Y  \ / __ \_ \___ \ |   Y  \                   //
//             /_______  /|__|_|  /(____  //____  >|___|  /                   //
//                     \/       \/      \/      \/      \/                    //
//                 __________                                                 //
//                 \______   \_______   ____   ______                         //
//                  |    |  _/\_  __ \ /  _ \ /  ___/                         //
//                  |    |   \ |  | \/(  <_> )\___ \                          //
//                  |______  / |__|    \____//____  > /\                      //
//                         \/                     \/  \/                      //
//                                                                            //
//                            -By Jayz Facez-                                 //
//                            -January  2008-                                 //
//____________________________________________________________________________//
//                                                                            //
                     Note: 2 Playa Has not been tested yet!

//Emulator Setup
//Playa 1
//A=A
//B=B
//Z=Z
//R=R
//L=L
//Analog Stick=Arrow keys
//Start=Enter


//Playa 2
//A=K
//B=G
//Z=J
//R=H
//L=F
//Analog Stick=Home, Delete, End, Home Buttons
//Start=Shift


//Special Controls
//*If there isn't Nunchuk plugged into the control the script is automatically
//set to NES Style Mode.
//*If there is a Nunchuk plugged into the control the script is automatically
//set to Nunchuk Style Mode.

//*In nunchuk mode, wave the wiimote Up, down, left or right to perform a smash
//attack in that direction.


//Debug
debug = 'RelAccX = '+Wiimote.RelAccX+'    RelAccY = '+Wiimote.Nunchuk.RelAccY



//____________________________________________________________________________//
//                               Player 1                                     //

//Playa LEDS
wiimote1.led1 = 1
wiimote1.led2 = 0
wiimote1.led3 = 0
wiimote1.led4 = 0

//Mode Switching
if Wiimote1.Nunchuk.Exists
  var.mode = 1
else
  var.mode = 0
end if


//Mode 1 (Var.Mode = 0)
//NES Style Controller
if var.mode = 0

  //Controls
  Left = Wiimote1.Up
  Right = Wiimote1.Down
  Up = Wiimote1.Right
  Down = Wiimote1.Left
  A = Wiimote1.Two
  Key.B = Wiimote1.One
  Key.R = Wiimote1.B
  Key.Z = Wiimote1.A
  Key.Enter = Wiimote1.Home
end if







//Mode 2 (Var.Mode = 1)
//Nunchuk Style
if var.mode = 1

  //Nunchuk Movement
  if 2 > Wiimote1.Nunchuk.JoyX > 0.5 then
    Right = true
    wait 60 ms
    Right = false
  endif
  if -2 < Wiimote1.Nunchuk.JoyX < -0.5 then
    left = true
    wait 60 ms
    left = false
  endif
  if 2 > Wiimote1.Nunchuk.JoyY > 0.5 then
    down = true
    wait 60 ms
    down = false
  endif
  if -2 < Wiimote1.Nunchuk.JoyY < -0.5 then
    up = true
    wait 60 ms
    up = false
  endif

  //Controls
  Key.A = Wiimote1.A
  Key.B = Wiimote1.B
  Key.R = Wiimote1.Down
  Key.Z = Wiimote1.Nunchuk.ZButton
  Key.L = Wiimote1.Nunchuk.CButton
  Key.Enter = Wiimote1.Home

  //Smash Attacks (Wiimote)
  if Wiimote1.RelAccX < - 25
    Key.Left = 1
    Key.A = 1
    wait 120 ms
    Key.Left = 0
    Key.A = 0
  end if
  if Wiimote1.RelAccX > 25
    Key.Right = 1
    Key.A = 1
    wait 120 ms
    Key.Right = 0
    Key.A = 0
  end if
  if Wiimote1.RelAccY < - 25
    Key.Down = 1
    Key.A = 1
    wait 120 ms
    Key.Down = 0
    Key.A = 0
  end if
  if Wiimote1.RelAccy > 25
    Key.Up = 1
    Key.A = 1
    wait 120 ms
    Key.Up = 0
    Key.A = 0
  end if




//____________________________________________________________________________//
//                                 Player 2                                   //


//Mode Switching
if Wiimote2.Nunchuk.Exists
  var.mode2 = 1
else
  var.mode2 = 0
end if


//Playa LEDS
wiimote2.led1 = 1
wiimote2.led2 = 1
wiimote2.led3 = 0
wiimote2.led4 = 0


//Mode 1 (Var.Mode2 = 0)
//NES Style Controller
if var.mode2 = 0

  //Controls
  Delete = Wiimote2.Up
  PageDown = Wiimote2.Down
  Home = Wiimote2.Right
  End = Wiimote2.Left
  k = Wiimote1.Two
  Key.g = Wiimote2.One
  Key.h = Wiimote2.B
  Key.j = Wiimote2.A
  Key.Shift = Wiimote2.Home
end if







//Mode 2 (Var.Mode2 = 1)
//Nunchuk Style
if var.mode2 = 1

  //Nunchuk Movement
  if 2 > Wiimote2.Nunchuk.JoyX > 0.5 then
    Delete = true
    wait 60 ms
    Delete = false
  endif
  if -2 < Wiimote2.Nunchuk.JoyX < -0.5 then
    pagedown = true
    wait 60 ms
    pagedown = false
  endif
  if 2 > Wiimote2.Nunchuk.JoyY > 0.5 then
    end = true
    wait 60 ms
    end = false
  endif
  if -2 < Wiimote2.Nunchuk.JoyY < -0.5 then
    home = true
    wait 60 ms
    home = false
  endif

  //Controls
  Key.k = Wiimote2.A
  Key.g = Wiimote2.B
  Key.h = Wiimote2.Down
  Key.j = Wiimote2.Nunchuk.ZButton
  Key.f = Wiimote2.Nunchuk.CButton
  Key.Shift = Wiimote2.Home

  //Smash Attacks (Wiimote)
  if Wiimote2.RelAccX < - 25
    Key.delete = 1
    Key.k = 1
    wait 120 ms
    Key.delete = 0
    Key.k = 0
  end if
  if Wiimote2.RelAccX > 25
    Key.pagedown = 1
    Key.k = 1
    wait 120 ms
    Key.pagedown = 0
    Key.k = 0
  end if
  if Wiimote2.RelAccY < - 25
    Key.end = 1
    Key.k = 1
    wait 120 ms
    Key.end = 0
    Key.k = 0
  end if
  if Wiimote2.RelAccy > 25
    Key.home = 1
    Key.k = 1
    wait 120 ms
    Key.home = 0
    Key.k = 0
  end if




//____________________________________________________________________________//
//                                                                            //
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