Author Topic: [Script]Mario Tennis 64  (Read 5905 times)

Offline harmor

  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
on: January 13, 2009, 07:52:41 AM
This is a little script I made for Mario Tennis 64.

Code: [Select]
/*
Mario Tennis 64
By Andrew Harmor
For Project64 (Using default controls)

Roll the Wiimote side to side to move character
Holding the "B" button will allow you to use the directional pad for menus

"A" Button on remote is "X" key on keyboard
"Down" arrow on remote is "C" key on keyboard
*/
Key.Up = Wiimote1.Right
Key.Left = Wiimote1.Up
//Key.Down = Wiimote1.Left
//Key.Right = Wiimote1.Down
Key.Enter = Wiimote1.Home
Key.X = Wiimote1.A
Key.C = Wiimote1.Down
Key.Z = Wiimote1.B
Key.A = Wiimote1.Minus
Key.S = Wiimote.Plus

if Wiimote.A then
  Wiimote.Rumble = true
else
  Wiimote.Rumble = false
end if

//debug = Wiimote1.RelAccX

// set these to the offsets when the wiimote is at rest
// will be different for each wiimote
var.x = Wiimote.RawForceX +1.00 //trim to 0
var.y = Wiimote.RawForceY -35.00 // trim to 0
var.z = Wiimote.RawForceZ +10.00 //trim to 0

//precision
var.threshx = 10


debug = "Var: " + var.x + " Thresh: " + var.threshx

//first sensitivity setting
//xaxis
if Wiimote.B == false{
   if var.x > var.threshx{
      Key.Right = false
      Key.Left = true
      var.x = 0
   }
   if var.x < -var.threshx{
      Key.Left = false
      Key.Right = true
      var.x = 0
   }
}else{
 Key.Left = Wiimote1.Left
 Key.Right = wiimote1.Right
 }