Walaber's Jellocar

From WiiLi

Jump to: navigation, search


/*
Jellocar Script 0.9
by TiagoTiago

made for playing Wallaber's great game Jellocar on the pc in analog mode
without requiring a Xbox controler much less an actual Xbox

inpired by:
http://www.wiili.org/index.php/GlovePIE:Pulsing_Algorithm
==============================================================================
uses the nunchuk but with a little fiddling will work with just about any analog input

to turn the controls on/off press A ont he wiimote (the buttons on the nunchuk
will remain operational)
leds:
.**.  = OFF
*..*  = ON

controles


counter-clockwise rotation:        \ (tilt the nunchuk like this
clockwise rotation:                / (tilt the nunchuk this way
accelerate (move right) :           move the nunchuk stick to the right
brake/reverse (move left):          move the nunchuk stick left
morph (change size):                C or Z buttom on the nunchuk

*/
var.Jjoyx = ensuremaprange(wiimote.Nunchuk.JoyX, -0.7,0.7, -1.0,1.0)
var.JjoyY = ensuremaprange(wiimote.Nunchuk.Roll, -30.0,30.0, -1.0,1.0)
var.joyx = deadzone(var.jjoyx,0.1) * var.enabled
var.joyy = deadzone(var.jjoyy,0.1) *var.enabled

// pulse X axis
var.PulseX = var.PulseX + Abs(var.JoyX)
if var.PulseX >= 1.0 // pulse!
    Key.Left   = var.JoyX < 0
    Key.Right  = var.JoyX > 0
    var.PulseX = var.PulseX - 1.0
else
    Key.Left   = false
    Key.Right  = false
end

// pulse Y axis
var.PulseY = var.PulseY + Abs(var.JoyY)
if var.PulseY >= 1.0 // pulse!
    Key.Z     = var.JoyY < 0
    Key.X   = var.JoyY > 0
    var.PulseY = var.PulseY - 1.0
else
    Key.Z     = false
    Key.X   = false
end

key.Space = wiimote.Nunchuk.CButton OR wiimote.Nunchuk.zButton



if pressed(wiimote.A)
var. enabled = not(var.enabled)
endif

wiimote.Led1 = var.enabled
wiimote.Led2 = not(var.enabled)
wiimote.Led3 = not(var.enabled)
wiimote.Led4 = var.enabled
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