WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

virtua tennis again..

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie
View previous topic :: View next topic  
Author Message
Lotti



Joined: 08 Jan 2007
Posts: 17

Digg It
PostPosted: Sun Jan 28, 2007 10:17 pm    Post subject: virtua tennis again..

let's see togheter this script for virtua tennis that enables you to play like wiisport tennis but with nunchuk movements!! Razz

Code:

// Lotti's Virtua Tennis Script

// X/Y offsets for Analog. If it's too sensitive then make the numbers larger.
var.xNunchukOff = .07
var.yNunchukOff = .07

//Switch off the leds
Wiimote.leds = 0

// Motion Mouse
// Manual Configuration
// When configuring the offsets please put the wiimote flat and do not move it.
// These are offsets change them so that your debug output reads 0,28,0
// The debug output is at the top of this window.
// Ex if you get -7,33,-6 then change the offsets to 7,-5,6

var.xOffset = 5
var.yOffset = -2
var.zOffset = 4

var.xRot = Wiimote.RawForceX + var.xOffset
var.yRot = Wiimote.RawForceY + var.yOffset
var.zRot = Wiimote.RawForceZ + var.zOffset

debug = 'X:' + var.xRot + ', ' + 'Y:' + var.yRot + ', ' + 'Z:' + var.zRot

// Automatic Configuration
// Simple press - and + buttons on wiimote before start playing
   if Wiimote.Minus && Wiimote.Plus then
      var.xOffset = -Wiimote.RawForceX
      var.zOffset = -Wiimote.RawForceZ
      var.yOffset = -Wiimote.RawForceY + 28
      debug = debug + ' Autocalibration'
  endif

//
// Game buttons.
//

key.Enter = Wiimote.Home
key.a = Wiimote.A
key.s = Wiimote.B
key.a = Wiimote.Nunchuk.ZButton

key.Tab = Wiimote.One
key.Space = Wiimote.Two

//
// Analog Movements
//

   if Wiimote.Nunchuk.JoyX < -var.xNunchukOff then
      key.Left = true
      else key.Left = false
   endif
   if Wiimote.Nunchuk.JoyX > var.xNunchukOff then
      key.Right = true
      else key.Right = false
   endif
   if Wiimote.Nunchuk.JoyY < -var.yNunchukOff then
      key.Up = true
      else key.Up = false
   endif
   if Wiimote.Nunchuk.JoyY > var.yNunchukOff then
      key.Down = true
      else key.Down = false
   endif

//
// Wiimote Movements
//

if abs(var.zRot) >= 20 && var.yRot >= 20 && var.yRot <= 35 then   // For Forehand/Backhand
   key.a = true
   Wiimote.Rumble = True
   Wait abs(var.zRot) ms
   Wiimote.Rumble = False
   key.a = false
endif
if var.yRot >= 50 && var.zRot >= -5 && var.zRot <= 5 then  //  For Lob
   key.s = true
   Wiimote.Rumble = True
   Wait var.yRot-28 ms
   Wiimote.Rumble = False
   key.s = false
endif
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group