wtz54321
Joined: 31 Mar 2007 Posts: 2
Digg It |
Posted: Sat Mar 31, 2007 10:33 am Post subject: To use 4 wiimote to play combat emulator game ? |
|
|
I write some code to test if I can use 2 wiimote to conrol to left , 2 level punch and 2 level kick ... I only know how to let Key.left = true if wiimote.1 and wiimote.2 move together ...
But My idea is to use 4 wiimote to control 1 player
If I attach Wiimote.1 to left hand , Wiimote.2 to right hand
Wiimote.3 to left leg , Wiimote.4 right leg
If wiimote.3 move forward and wait for a second wiimote.4 move forward
or wiimote.4 move forward and wait for a second wiimote.3 move forward
then Key.Right=True
If wiimote.3 move backward and wait for a second wiimote.4 move backward
or wiimote.4 move backward and wait for a second wiimote.3 move backward
then Key.Left=True
If wiimote.3 and wiimote.4 move upward together then Key.Up=True
If wiimote.1 and wiimote.2 move downward together then Key.Down=True
If wiimote.1 or wiimote.2 level 1 acceleration detected , then Key.A=true=Level 1 Punch
If wiimote.1 or wiimote.2 level 2 acceleration detected , then Key.S=true=Level 2 Punch
If wiimote.1 or wiimote.2 level 3 acceleration detected , then Key.D=true==Level 3 Punch
If wiimote.3 or wiimote.4 level 1 acceleration detected , then Key.Z=true=Level 1 Kick
If wiimote.3 or wiimote.4 level 2 acceleration detected , then Key.X=true=Level 2 Kick
If wiimote.3 or wiimote.4 level 3 acceleration detected , then Key.C=true=Level 3 Kick
I am bad in code language , anyone can help me to translate the requirement to final scrip ?
===============================================
var.xOffset = 8
var.yOffset = -37
var.zOffset = 12
var.xRot1 = Wiimote1.RawForceX + var.xOffset
var.yRot1 = Wiimote1.RawForceY + var.yOffset
var.zRot1 = Wiimote1.RawForceZ + var.zOffset
var.xRot2 = Wiimote2.RawForceX + var.xOffset
var.yRot2 = Wiimote2.RawForceY + var.yOffset
var.zRot2 = Wiimote2.RawForceZ + var.zOffset
debug = "X=" + var.xRot + " Y=" + var.yRot + " Z=" + var.zRot
if var.yRot1 > 30 then
var.L1 = True
else
var.L1 = False
endif
if var.yRot1 > 70 then
var.P1 = Wiimote1.A and not (Wiimote1.B or Wiimote1.Minus or Wiimote1.Home or Wiimote1.Plus or Wiimote1.One or Wiimote1.Two)
else
var.P1 = False
endif
if var.yRot1 > 10 but < 40 then
var.P3 = Wiimote1.A and not (Wiimote1.B or Wiimote1.Minus or Wiimote1.Home or Wiimote1.Plus or Wiimote1.One or Wiimote1.Two)
else
var.P3 = False
endif
if var.yRot2 > 30 then
var.L2 = True
else
var.L2 = False
endif
if var.yRot2 > 70 then
var.P2 = Wiimote2.A and not (Wiimote2.B or Wiimote2.Minus or Wiimote2.Home or Wiimote2.Plus or Wiimote2.One or Wiimote2.Two)
else
var.P2 = False
endif
if var.yRot2 > 10 but < 40 then
var.P4 = Wiimote2.A and not (Wiimote2.B or Wiimote2.Minus or Wiimote2.Home or Wiimote2.Plus or Wiimote2.One or Wiimote2.Two)
else
var.P4 = False
endif
if var.L1 = True and var.L2= True then
var.LL = True
else
var.LL = False
endif
Key.Left = var.LL
Key.A = var.P1
Key.S = var.P2
Key.D = var.P3
Key.F = var.P4 |
|