script for fps games
Posted: Sun Apr 06, 2014 5:18 am
anyone have a script for fps games using wiimote plus for mouse emulation and nunchuck for movement. iam new to this and i dont have any experience writing scripts.
The Number One Resource For Stereoscopic 3D Excitement!
https://www.mtbs3d.com/phpbb/
Code: Select all
def motionUpdate():
mouse.deltaX = filters.deadband(filters.delta(wiimote[0].ahrs.yaw), 0.1) * scale
mouse.deltaY = filters.deadband(-filters.delta(wiimote[0].ahrs.pitch), 0.1) * scale
def buttonUpdate():
keyboard.setKey(Key.W, wiimote[0].nunchuck.buttons.button_down(WiimoteButtons.DPadUp))
keyboard.setKey(Key.S, wiimote[0].nunchuck.buttons.button_down(WiimoteButtons.DPadDown))
keyboard.setKey(Key.A, wiimote[0].nunchuck.buttons.button_down(WiimoteButtons.DPadLeft))
keyboard.setKey(Key.D, wiimote[0].nunchuck.buttons.button_down(WiimoteButtons.DPadRight))
if starting:
scale = 10
wiimote[0].enable(WiimoteCapabilities.MotionPlus)
wiimote[0].motionplus.update += motionUpdate
wiimote[0].buttons.update += buttonUpdate