Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

versions 0.18+ and some extras #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions GlovePIE-0.21/BalloonPop.pie
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var.downleft = (p5.XVelocity < -1mps) and (p5.YVelocity < -1mps)
var.downright = (p5.XVelocity > 1mps) and (p5.YVelocity < -1mps)
var.straightright = (p5.XVelocity > 1mps) and (abs(p5.YVelocity) < 0.3mps) and (abs(p5.ZVelocity)<0.5mps)
var.straightleft = (p5.XVelocity < -1mps) and (abs(p5.YVelocity) < 0.3mps) and (abs(p5.ZVelocity)<0.5mps)
var.curvedright = (p5.XVelocity > 1mps) and (abs(p5.YVelocity) < 0.6mps) and (abs(p5.ZVelocity)<0.5mps)
var.curvedleft = (p5.XVelocity < -1mps) and (abs(p5.YVelocity) < 0.6mps) and (abs(p5.ZVelocity)<0.5mps)
var.down = (p5.YVelocity < -1mps) and (abs(p5.XVelocity) < 0.3mps) and (abs(p5.ZVelocity)<0.5mps)
var.still = HeldDown(p5.Speed < 0.3mps, 250ms)
var.curvedup = (abs(p5.xvelocity) < 0.6mps) and (abs(p5.YVelocity) > 1mps) and (abs(p5.ZVelocity<0.5mps))

//var.one = p5.Speed < 0.1mps, (p5.YVelocity < -1mps), p5.Speed < 0.1mps
//var.two = (p5.XVelocity > 1 mps) and (abs(p5.YVelocity) < 1mps), (P5.XVelocity < -1 mps) and (p5.YVelocity < -1mps), (p5.XVelocity > 1 mps) and (abs(p5.YVelocity)<0.2mps)
//var.four = (p5.XVelocity < -1mps) and (p5.YVelocity<-1mps), (p5.XVelocity>
var.one = var.still,var.down,var.still
var.two = var.curvedright,var.downleft,var.straightright,var.still
var.three = var.curvedright,var.downleft,var.downright,var.curvedleft
var.four = var.downleft, var.straightright, var.down
var.five = var.straightleft, var.down, var.curvedright, var.curvedleft, var.still
var.six = var.downleft, var.downright, var.curvedup, var.curvedleft
var.seven = var.straightright, var.downleft,var.still
var.eight = var.curvedright, var.downleft, var.curvedright, var.upleft
var.nine = var.curvedleft, var.curvedright, var.down
debug = var.one +', '+var.two+', '+var.three+', '+var.four+', '+var.five+', '+var.Six+', '+var.Seven
File renamed without changes.
17 changes: 17 additions & 0 deletions GlovePIE-0.21/CurveGestures.PIE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
debug = var.CompleteCircleZ+', '+ pie.FrameRate
// Get the acceleration and velocity
var.a = RemoveUnits(smooth(p5.Acceleration in m per s per s))
var.v = RemoveUnits(smooth(p5.Velocity in m per s))

//debug = sin(math.AngleBetween(var.a, var.v))* |var.a|*|var.v|

// Calculate the cross product
// Cross product is large if both are large, and large if they are perpendicular
// It is also at right angles to both.
var.curvature = smooth(var.a cross var.v)
var.ClockwiseZ = var.curvature[3]
var.ClockwiseY = var.curvature[2]
var.ClockwiseX = var.curvature[1]

var.CompleteCircleZ = (var.ClockwiseZ>2) and (var.v[2]<-1), (var.ClockwiseZ>2) and (var.v[2]>1)//, (var.ClockwiseZ>2) and (var.v[2]1)

3,802 changes: 3,802 additions & 0 deletions GlovePIE-0.21/Documentation.rtf

Large diffs are not rendered by default.

File renamed without changes.
Binary file added GlovePIE-0.21/GlovePIE.exe
Binary file not shown.
20 changes: 20 additions & 0 deletions GlovePIE-0.21/NewSamples/AskForWeapons.PIE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Use spoken requests to ask for weapons.
// Like "can I please have a rocket launcher"
// You can't just say "rocket launcher" like with the Said("") function.
// Only some forms of requests are currently implemented
// You can also test that it is hearing you, by saying "test"

Key.F = AskedFor("torch") or AskedFor("flashlight")
Key.One = AskedFor("fist")
Key.Two = AskedFor("pistol")
Key.Three = AskedFor("shotgun")
Key.Four = AskedFor("machine gun")
Key.Five = AskedFor("chain gun")
Key.Six = AskedFor("grenade")
Key.Seven = AskedFor("plasma gun")
Key.Eight = AskedFor("rocket launcher")
Key.Nine = AskedFor("BFG", 4) or AskedFor("Big Fucking Gun", 4) or AskedFor("BFG 9000", 4)
Key.Zero = AskedFor("chainsaw")
Key.Q = AskedFor("soul cube")

Key.T = said("test")
4 changes: 4 additions & 0 deletions GlovePIE-0.21/NewSamples/BreathMouse.PIE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Breath mouse
// Blow into the microphone to press the left mouse button

Mouse.LeftButton = microphone.AudioLevel > 30%
16 changes: 16 additions & 0 deletions GlovePIE-0.21/NewSamples/GreekSecondKeyboard.PIE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Requires Windows XP

// Only keyboard 2 will type in Greek
// Keyboard 1 will type like normal
// Currently only does Alpha, Beta, Gamma, Delta, Epsilon and Zeta
// This is a demo for sending unicode characters,
// and for reading multiple keyboards

key.BackSpace = key2.A or key2.B or key2.G or key2.D or key2.D or key2.E or key2.Z
key.Unicode03B1 = key2.A
key.Unicode03B2 = key2.B
key.Unicode03B3 = key2.G
key.Unicode03B4 = key2.D
key.Unicode03B5 = key2.E
key.Unicode03B6 = key2.Z

106 changes: 106 additions & 0 deletions GlovePIE-0.21/NewSamples/HapticSphere.pie
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
// You need a P5 Glove holding a vibrating gamepad.
// This script uses joystick 1, but you can change it at the bottom.

// This is the first game I have seen that has NO GRAPHICS, NO SOUND,
// and NO normal input device. You can play this game blindfolded
// with your ears blocked. It uses only the sense of touch.

// There is a row of 3 magical spheres hovering 50cm in front of the
// red LED.
// They is 20 cm wide. Your hand will shake when it is inside a sphere.
// You can grab a sphere and move it around. You can feel when you
// are holding it. The sphere will hover wherever you release it.
// One sphere is empty, one is partly full, and one is quite full.
// Shake the spheres to feel the difference.
// If you lose a sphere, press the A B or C button to teleport that
// sphere into your hand.

if not var.Initialized then
var.Ball1Pos = [0 cm, 0 cm, -50 cm]
var.Ball0Pos = [-40 cm, 0 cm, -50 cm]
var.Ball2Pos = [40 cm, 0 cm, -50 cm]
var.Ball1Radius = 10 cm
var.Ball0Radius = 10 cm
var.Ball2Radius = 10 cm
var.HoldingSphere1 = false
var.HoldingSphere0 = false
var.HoldingSphere2 = false
var.HoldingSphere = false
var.Sphere0Full = 0
var.Sphere1Full = 1
var.Sphere2Full = 2
var.Initialized = true
endif

var.Distance0 = (p5.Pos - var.Ball0Pos) in cm
var.Distance1 = (p5.Pos - var.Ball1Pos) in cm
var.Distance2 = (p5.Pos - var.Ball2Pos) in cm
var.DistanceInsideSphere0 = (var.Ball0Radius - |var.Distance0|) / var.Ball0Radius
var.DistanceInsideSphere1 = (var.Ball1Radius - |var.Distance1|) / var.Ball1Radius
var.DistanceInsideSphere2 = (var.Ball2Radius - |var.Distance2|) / var.Ball2Radius
var.IsInsideSphere0 = var.DistanceInsideSphere0 >= 0
var.IsInsideSphere1 = var.DistanceInsideSphere1 >= 0
var.IsInsideSphere2 = var.DistanceInsideSphere2 >= 0
if Var.DistanceInsideSphere0 < 0 then var.DistanceInsideSphere0 = 0
if Var.DistanceInsideSphere1 < 0 then var.DistanceInsideSphere1 = 0
if Var.DistanceInsideSphere2 < 0 then var.DistanceInsideSphere2 = 0

if var.IsInsideSphere0 and p5.xnnnx but not var.HoldingSphere then
var.HoldingSphere0 = true
var.HoldingSphere = true
endif
if var.IsInsideSphere1 and p5.xnnnx but not var.HoldingSphere then
var.HoldingSphere1 = true
var.HoldingSphere = true
endif
if var.IsInsideSphere2 and p5.xnnnx but not var.HoldingSphere then
var.HoldingSphere2 = true
var.HoldingSphere = true
endif

if var.HoldingSphere0 but not p5.xnnnx then
var.HoldingSphere0 = false
endif
if var.HoldingSphere1 but not p5.xnnnx then
var.HoldingSphere1 = false
endif
if var.HoldingSphere2 but not p5.xnnnx then
var.HoldingSphere2 = false
endif

if pressed(p5.A) then var.Ball0Pos = p5.Pos
if pressed(p5.B) then var.Ball1Pos = p5.Pos
if pressed(p5.C) then var.Ball2Pos = p5.Pos

var.HoldingSphere = var.HoldingSphere0 or var.HoldingSphere1 or var.HoldingSphere2

if var.HoldingSphere then
var.SolidRumble = 0
var.GripRumble = 50%
var.Acc = |(p5.Acceleration in metres per second per second)|
var.Acc = RemoveUnits(var.Acc + smooth(var.Acc,3)) / 100
if var.Acc < 0.05 then var.Acc = 0
if var.HoldingSphere0 then
var.ShakeRumble = var.Acc * var.Sphere0Full
var.Ball0Pos = p5.Pos in cm
var.SolidRumble = var.DistanceInsideSphere1 + var.DistanceInsideSphere2
endif
if var.HoldingSphere1 then
var.ShakeRumble = var.Acc * var.Sphere1Full
var.Ball1Pos = p5.Pos in cm
var.SolidRumble = var.DistanceInsideSphere0 + var.DistanceInsideSphere2
endif
if var.HoldingSphere2 then
var.ShakeRumble = var.Acc * var.Sphere2Full
var.Ball2Pos = p5.Pos in cm
var.SolidRumble = var.DistanceInsideSphere0 + var.DistanceInsideSphere1
endif
else
var.SolidRumble = var.DistanceInsideSphere0 + var.DistanceInsideSphere1 + var.DistanceInsideSphere2
var.GripRumble = 0
var.ShakeRumble = 0
endif

joy1.Vibration1 = var.SolidRumble + var.ShakeRumble
joy1.Vibration2 = var.GripRumble

116 changes: 116 additions & 0 deletions GlovePIE-0.21/NewSamples/IL2SmokeSignals.PIE
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// IL-2 STURMOVIK
// Lights and Smoke Signals
// by tommygunner70 (T.C Helsingen) and Carl Kenner

// NumPad 1 to NumPad 6 start a signal loop
// NumPad 0 stops a signal loop


//////////////////////////
// Initialize
////////////////////////
if not var.Initialized then
var.SignalLoop = 0
var.SignalPos = 0
var.Lights = false
var.Smoke = false
var.Initialized = true
end if

////////////////////////////////
// Keys to change signal loop
//////////////////////////////
if pressed(Numpad1) then
var.SignalLoop = 1
var.SignalPos = 1
end if

if pressed(NumPad2) then
var.SignalLoop = 2
var.SignalPos = 1
end if

if pressed(NumPad3) then
var.SignalLoop = 3
var.SignalPos = 1
end if

if pressed(NumPad0) then
var.Lights = false
var.Smoke = false
var.SignalLoop = 0
var.SignalPos = 0
end if

//////////////////////////
// signal loop number 1
////////////////////////
if var.SignalLoop = 1 and var.SignalPos = 1 then
var.Smoke = true
var.Lights = false
wait 1 s
if var.SignalLoop = 1 and var.SignalPos = 1 then var.SignalPos = var.SignalPos + 1
end if

if var.SignalLoop = 1 and var.SignalPos = 2 then
var.Smoke = false
var.Lights = false
wait 1 s
if var.SignalLoop = 1 and var.SignalPos = 2 then var.SignalPos = 1
end if

//////////////////////////
// signal loop number 2
////////////////////////
if var.SignalLoop = 2 and var.SignalPos = 1 then
var.Lights = true
var.Smoke = false
wait 1 s
if var.SignalLoop = 2 and var.SignalPos = 1 then var.SignalPos = var.SignalPos + 1
end if

if var.SignalLoop = 2 and var.SignalPos = 2 then
var.Lights = false
var.Smoke = false
wait 1 s
if var.SignalLoop = 2 and var.SignalPos = 2 then var.SignalPos = 1
end if

//////////////////////////
// signal loop number 3
////////////////////////
if var.SignalLoop = 3 and var.SignalPos = 1 then
var.Smoke = true
var.Lights = false
wait 1 s
if var.SignalLoop = 3 and var.SignalPos = 1 then var.SignalPos = var.SignalPos + 1
end if

if var.SignalLoop = 3 and var.SignalPos = 2 then
var.Smoke = false
var.Lights = true
wait 1 s
if var.SignalLoop = 3 and var.SignalPos = 2 then var.SignalPos = 1
end if


//////////////////////////
// Do the toggling
////////////////////////

var.ToggleLights = pressed(var.Lights) or released(var.Lights)
var.ToggleSmoke = pressed(var.Smoke) or released(var.Smoke)

if var.ToggleLights then
press key.L
wait 100 ms
release key.L
end if

if var.ToggleSmoke then
press key.T
wait 100 ms
release key.T
end if


23 changes: 23 additions & 0 deletions GlovePIE-0.21/NewSamples/KeyboardCursor.PIE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Requires Windows 2000 or above (Doesn't need XP)
// Keyboard controlled cursor
// Arrow keys move cursor 2, Right Alt and Right Ctrl are the buttons

if not var.initialized then
var.c2x = Screen.Width / 2
var.c2y = Screen.Height / 2
Cursor2.PosX = var.c2x
Cursor2.PosY = var.c2y
Cursor2.Visible = true
var.initialized = true
end if

if Left then var.c2x = var.c2x - 4
if Right then var.c2x = var.c2x + 4
if Up then var.c2y = var.c2y - 4
if Down then var.c2y = var.c2y + 4

Cursor2.PosX = var.c2x
Cursor2.PosY = var.c2y
Cursor2.LeftButton = RightAlt
Cursor2.RightButton = RightCtrl

13 changes: 13 additions & 0 deletions GlovePIE-0.21/NewSamples/MidiScale.PIE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Play two notes at once based on the cursor position

midi.FirstNote = mouse.x * 127
midi.SecondNote = mouse.y * 127

// note that notes are numbered from 0 to 127
// with 0 being the low C note in octave 0
// and 127 being the high G note in octave 10
// each octave has 12 notes (octaves never have 8 notes)
// C, C#, D, D#, E, F, F#, G, G#, A, A#, B
// Middle C is note 60
// set it to -1 to not play any note

17 changes: 17 additions & 0 deletions GlovePIE-0.21/NewSamples/Mouse1only.PIE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Only mouse1 will control the system mouse!
mouse.Swallow = true
mouse.DirectInputX = mouse.DirectInputX + var.MouseDeltaX
mouse.DirectInputY = mouse.DirectInputY + var.MouseDeltaY

var.MouseDeltaX = mouse1.DirectInputX - var.MouseOldX
var.MouseDeltaY = mouse1.DirectInputY - var.MouseOldY

var.MouseOldX = mouse1.DirectInputX
var.MouseOldY = mouse1.DirectInputY

mouse.LeftButton = mouse1.LeftButton
mouse.RightButton = mouse1.RightButton
mouse.MiddleButton = mouse1.MiddleButton
mouse.XButton1 = mouse1.XButton1
mouse.XButton2 = mouse1.XButton2

Loading