Skip to content

Commit

Permalink
Switch to regular InputEvents
Browse files Browse the repository at this point in the history
Fix hand position in hand tracking mode
Add image that explains nodding
  • Loading branch information
mgschwan committed Jan 23, 2021
1 parent 93f52b4 commit 1b33fdd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions godot_project/ControllerScript.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ var tracking_lost = false
var collision_root = null
var model = null



var hand_mode = false


Expand Down Expand Up @@ -110,6 +112,10 @@ func get_hit_velocity():
get_parent().get_parent().level.infolayer.print_info("Velocity %.2f"%velocity, "debug")
return velocity

func get_touch_object():
#If we add different touch shapes that would have to be return here
return model


func do_rumble(good = true):
if good:
Expand Down
3 changes: 2 additions & 1 deletion godot_project/scenes/Levelselect.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,13 @@ transform = Transform( -1.74846e-08, 0, -0.4, 0, 0.4, 0, 0.4, 0, -1.74846e-08, 0
[node name="MainText" parent="." instance=ExtResource( 17 )]
transform = Transform( -1.54463e-07, -0.974043, 0.226362, -7.37582e-08, -0.226362, -0.974043, 1, -1.6715e-07, -3.68791e-08, 2.17868, 2.30847, 3.54952e-07 )
default_text = "VRWorkout"
bbtext = true

[node name="text_panel" parent="MainText" instance=ExtResource( 18 )]
transform = Transform( 1.1, 0, -9.32587e-16, 0, 1, 0, 1.70974e-15, 0, 0.6, 6.68336e-11, -0.00769687, 0.00178862 )

[node name="Tutorial" parent="." instance=ExtResource( 17 )]
transform = Transform( 0.384669, -0.854052, 0.158781, -7.05189e-08, -0.226362, -0.779235, 0.701449, 0.468355, -0.0870744, 1.57591, 2.58036, -2.13026 )
transform = Transform( -0.800001, -4.41957e-07, 2.15876e-08, 5.90066e-08, -0.226362, -0.779235, 3.49275e-07, -0.974044, 0.18109, -0.268867, 2.308, 3.26218 )

[node name="text_panel" parent="Tutorial" instance=ExtResource( 18 )]
transform = Transform( 1.2, 0, 0, 0, 1, 9.9729e-15, 0, -1.66215e-14, 0.6, 0, -0.0072, 0.00167334 )
Expand Down
4 changes: 2 additions & 2 deletions godot_project/scripts/ConnectPadInput.gd
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ func get_touch_position(body):

func touched_by_controller(body, root):
print ("Touched by %s"%str(body))
var touch_position = get_touch_position(body)
var touch_position = get_touch_position(body.get_touch_object())
emit_signal("interface_touch",touch_position[0],touch_position[1])

func released_by_controller(body, root):
print ("Released by %s"%str(body))
var touch_position = get_touch_position(body)
var touch_position = get_touch_position(body.get_touch_object())
emit_signal("interface_release",touch_position[0],touch_position[1])
2 changes: 1 addition & 1 deletion godot_project/scripts/GameVariables.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var hit_player = null

#############################################################################
############################ Activated features #############################
var FEATURE_MULTIPLAYER = true
var FEATURE_MULTIPLAYER = false

#############################################################################

Expand Down
4 changes: 2 additions & 2 deletions godot_project/scripts/Levelselect.gd
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ func _ready():
if GameVariables.current_song:
get_node("SongSelector").playlist_from_song_files(GameVariables.current_song)

get_node("MainText").print_info("VRWorkout\nSelect song by touching a block\nBest played hands only - no controllers\nPosition yourself between the green poles\nRun in place to get multipliers\n")
get_node("MainText").print_info("[img]res://assets/vrworkout_logo.png[/img]\nBuild a playlist with the songs to your right and press start.\n\nTip:\n- Play with hand tracking (no controllers)\n- Connect a heart rate sensor for dynamic difficulty\n- Join the discord for help")

get_node("Tutorial").print_info("How to play\n- Hit the hand cues to the beat of the music\n- Head cues should only be touched no headbutts\n- Run in place to receive point multipliers!\nThe optimal time to hit the cues is when the\nrotating marker meets the static one")
get_node("Tutorial").print_info("How to play\n-Position yourself between the green poles\n- Hit the hand cues to the beat of the music\n- Head cues should only be touched no headbutts\n- Run in place to receive point multipliers!\nThe optimal time to hit the cues is when the\nrotating marker meets the static one")

update_widget()
get_node("SongSelector").select_difficulty(GameVariables.difficulty)
Expand Down

0 comments on commit 1b33fdd

Please sign in to comment.