Skip to content

Commit

Permalink
Restructure the menus
Browse files Browse the repository at this point in the history
Fix performance issue in the menu
Fix blackout_screen not working
Add safety fence
  • Loading branch information
mgschwan committed May 22, 2021
1 parent 5db54b5 commit 856ad2f
Show file tree
Hide file tree
Showing 31 changed files with 782 additions and 821 deletions.
2 changes: 2 additions & 0 deletions godot_project/SongSelector.gd
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func update_songs():

root.set_text(0,"Total duration %s"%(gu.seconds_to_timestring(duration)))

print ("Update songs: changed")
emit_signal("content_changed")
#get_node("Viewport").render_target_update_mode = Viewport.UPDATE_ONCE

Expand Down Expand Up @@ -189,4 +190,5 @@ func _on_Resting_pressed():
update_songs()

func _on_TabContainer_content_changed():
print ("Tab container changed")
emit_signal("content_changed")
49 changes: 27 additions & 22 deletions godot_project/SongSelector.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[ext_resource path="res://scripts/TouchableViewport.gd" type="Script" id=8]
[ext_resource path="res://scenes/SongSelectionGUI.tscn" type="PackedScene" id=14]

[sub_resource type="StyleBoxFlat" id=9]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0, 0, 0, 0 )
border_width_left = 2
border_width_top = 2
Expand All @@ -19,51 +19,55 @@ corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5

[sub_resource type="BoxShape" id=1]
[sub_resource type="BoxShape" id=2]
margin = 0.001
extents = Vector3( 1, 0.033, 1.066 )

[sub_resource type="PlaneMesh" id=2]
[sub_resource type="PlaneMesh" id=3]
size = Vector2( 2, 2.133 )

[sub_resource type="ViewportTexture" id=3]
[sub_resource type="ViewportTexture" id=4]
flags = 12
viewport_path = NodePath("Viewport")

[sub_resource type="SpatialMaterial" id=4]
[sub_resource type="SpatialMaterial" id=5]
resource_local_to_scene = true
flags_transparent = true
flags_unshaded = true
albedo_texture = SubResource( 3 )
params_use_alpha_scissor = true
params_alpha_scissor_threshold = 0.98
albedo_texture = SubResource( 4 )

[sub_resource type="BoxShape" id=5]
[sub_resource type="BoxShape" id=6]
extents = Vector3( 1.5, 0.033, 1 )

[sub_resource type="PlaneMesh" id=6]
[sub_resource type="PlaneMesh" id=7]
size = Vector2( 3, 2 )

[sub_resource type="ViewportTexture" id=7]
[sub_resource type="ViewportTexture" id=8]
flags = 12
viewport_path = NodePath("SongSelector/Viewport")

[sub_resource type="SpatialMaterial" id=8]
[sub_resource type="SpatialMaterial" id=9]
resource_local_to_scene = true
flags_transparent = true
flags_unshaded = true
albedo_texture = SubResource( 7 )
params_use_alpha_scissor = true
params_alpha_scissor_threshold = 0.98
albedo_texture = SubResource( 8 )

[node name="Spatial" type="Spatial"]
script = ExtResource( 1 )

[node name="DifficultyButtons" parent="." instance=ExtResource( 5 )]
transform = Transform( 0.3, 0, 0, 0, -1.31134e-08, -0.3, 0, 0.3, -1.31134e-08, -1.41562, -0.206276, -0.000524152 )
transform = Transform( 0.259808, -0.15, 6.55671e-09, 0, -1.31134e-08, -0.3, 0.15, 0.259808, -1.13566e-08, 4.01036, -0.129954, 0.16975 )

[node name="Viewport" type="Viewport" parent="."]
size = Vector2( 512, 546 )
transparent_bg = true
msaa = 6
render_target_v_flip = true
render_target_update_mode = 3
render_target_update_mode = 1
script = ExtResource( 8 )

[node name="CanvasLayer" type="CanvasLayer" parent="Viewport"]
Expand All @@ -82,19 +86,19 @@ margin_top = 39.0
margin_right = 507.0
margin_bottom = 541.0
mouse_filter = 2
custom_styles/panel = SubResource( 9 )
custom_styles/panel = SubResource( 1 )

[node name="StaticBody" type="StaticBody" parent="."]
transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, -0.441766, 0 )
transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 2.6508, -0.441766, 0 )
script = ExtResource( 7 )

[node name="CollisionShape" type="CollisionShape" parent="StaticBody"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0552993, 0 )
shape = SubResource( 1 )
shape = SubResource( 2 )

[node name="MeshInstance" type="MeshInstance" parent="StaticBody"]
mesh = SubResource( 2 )
material/0 = SubResource( 4 )
mesh = SubResource( 3 )
material/0 = SubResource( 5 )

[node name="tl_marker" type="Spatial" parent="StaticBody"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, -1.067 )
Expand All @@ -106,24 +110,25 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, -1.067 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, 1.066 )

[node name="SongSelector" type="StaticBody" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 2.62802, -0.513638, -3.13141e-09 )
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0.0941151, -0.514, 0 )
script = ExtResource( 7 )

[node name="Viewport" type="Viewport" parent="SongSelector"]
size = Vector2( 768, 512 )
transparent_bg = true
msaa = 6
render_target_v_flip = true
render_target_update_mode = 1
script = ExtResource( 8 )

[node name="SongSelection" parent="SongSelector/Viewport" instance=ExtResource( 14 )]

[node name="CollisionShape" type="CollisionShape" parent="SongSelector"]
shape = SubResource( 5 )
shape = SubResource( 6 )

[node name="MeshInstance" type="MeshInstance" parent="SongSelector"]
mesh = SubResource( 6 )
material/0 = SubResource( 8 )
mesh = SubResource( 7 )
material/0 = SubResource( 9 )

[node name="tl_marker" type="Spatial" parent="SongSelector"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5, 0, -1 )
Expand Down
38 changes: 29 additions & 9 deletions godot_project/VRScene.gd
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,8 @@ func _on_level_finished_manually():
func _on_level_finished_actual(valid_end):
GameVariables.vr_camera.blackout_screen(true)
GameVariables.vr_camera.show_hud(false)
yield(get_tree().create_timer(0.1),"timeout")

#In case the player exited while controller were hidden
set_controller_visible(true)

Expand Down Expand Up @@ -827,11 +829,15 @@ func get_persisting_parameters():
"game/default_playlist" : GameVariables.current_song,
"game/exercise_duration_avg" :ProjectSettings.get("game/exercise_duration_avg"),
"game/environment" :ProjectSettings.get("game/environment"),
"game/hold_cues" :ProjectSettings.get("game/hold_cues")
"game/hold_cues" :ProjectSettings.get("game/hold_cues"),
"game/onboarding_complete" :ProjectSettings.get("game/onboarding_complete"),
}

var game_statistics = {}
func _on_Area_level_selected(filename, diff, num):
GameVariables.vr_camera.blackout_screen(true)
yield(get_tree().create_timer(0.1),"timeout")

if level == null:
GameVariables.current_song = filename
if $MultiplayerRoom.is_multiplayer_host():
Expand Down Expand Up @@ -916,39 +922,52 @@ func set_beast_mode(enabled):

func _on_Splashscreen_finished():
GameVariables.vr_camera.blackout_screen(true)
yield(get_tree().create_timer(0.1),"timeout")

splashscreen.queue_free()

get_node("SongDatabase").intialize_song_database()
var default_playlist = ProjectSettings.get("game/default_playlist")
if default_playlist:
GameVariables.current_song = default_playlist

start_levelselect()

if not GameVariables.vr_mode:
_on_Tracker_added("right", ARVRServer.TRACKER_CONTROLLER, 1)
_on_Tracker_added("left", ARVRServer.TRACKER_CONTROLLER, 2)

splashscreen.queue_free()
add_child(levelselect)
if not GameVariables.vr_mode:
pass
#get_node("DemoTimer").start()

if ProjectSettings.has_setting("game/onboarding_complete") and ProjectSettings.get("game/onboarding_complete"):
start_levelselect()
add_child(levelselect)
else:
_on_Onboarding_selected()



var onboarding_scene
func _on_Onboarding_selected():
GameVariables.vr_camera.blackout_screen(true)
yield(get_tree().create_timer(0.1),"timeout")
onboarding_scene = load("res://scenes/OnboardingStage.tscn").instance()
levelselect.queue_free()
if levelselect != null:
levelselect.queue_free()
add_child(onboarding_scene)
onboarding_scene.connect("onboarding_finished", self, "_on_Onboarding_finished")
#GameVariables.vr_camera.blackout_screen(false)

func _on_Onboarding_finished():
GameVariables.vr_camera.blackout_screen(true)
yield(get_tree().create_timer(0.1),"timeout")

ProjectSettings.set("game/onboarding_complete", true)
onboarding_scene.queue_free()
start_levelselect()

func change_environment(value):
print ("CHANGE ENV\n\n\n\n\n%s"%value)
GameVariables.vr_camera.blackout_screen(true)
yield(get_tree().create_timer(0.1),"timeout")

if value == "angry":
get_node("ARVROrigin/SkyBox").switch("angry")
ProjectSettings.set("game/environment",value)
Expand All @@ -958,6 +977,7 @@ func change_environment(value):
else:
get_node("ARVROrigin/SkyBox").switch("calm")
ProjectSettings.set("game/environment",value)
GameVariables.vr_camera.blackout_screen(false)



Expand Down
2 changes: 1 addition & 1 deletion godot_project/cue_emitter.gd
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func set_move_tween(cue_node, start_pos, end_pos, actual_flytime, curved_directi
else:
additional_move_modifier.interpolate_property(cue_node,"translation:y",0,GameVariables.player_height+1.5,actual_flytime*0.5,Tween.TRANS_LINEAR,Tween.EASE_IN_OUT,0)
additional_move_modifier.interpolate_property(cue_node,"translation:y",GameVariables.player_height+1.5,y,actual_flytime*0.5,Tween.TRANS_LINEAR,Tween.EASE_IN_OUT,actual_flytime*0.5)


additional_move_modifier.interpolate_property(cue_node,"translation:x",x,x+curved_direction,actual_flytime*0.5,Tween.TRANS_LINEAR,Tween.EASE_IN_OUT,0)
additional_move_modifier.interpolate_property(cue_node,"translation:x",x+curved_direction, 0,actual_flytime*0.5,Tween.TRANS_LINEAR,Tween.EASE_IN_OUT,actual_flytime*0.5)
Expand Down
4 changes: 2 additions & 2 deletions godot_project/export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ custom_features=""
export_filter="all_resources"
include_filter="*.json,*.ogg,*.wav,*.ogv"
exclude_filter="android/*"
export_path="../../../../../../tmp/VRWorkout_release_applab.apk"
export_path="../../../../../../tmp/VRWorkout_release_applab_nomp.apk"
script_export_mode=1
script_encryption_key=""

Expand All @@ -30,7 +30,7 @@ keystore/release="/home/developer/LVCC_Shared/michael/vrworkout/quest.keystore"
keystore/release_user="questkey"
keystore/release_password="gruluHuri43"
one_click_deploy/clear_previous_install=false
version/code=164
version/code=173
version/name="0.9.9r"
package/unique_name="org.godotengine.$genname"
package/name="VRWorkout"
Expand Down
26 changes: 14 additions & 12 deletions godot_project/scenes/DifficultyButtons.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,34 @@
[ext_resource path="res://scripts/ConnectPadInput.gd" type="Script" id=8]
[ext_resource path="res://scripts/TouchableViewport.gd" type="Script" id=9]

[sub_resource type="StyleBoxFlat" id=6]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.380392, 0.298039, 0.831373, 1 )
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5

[sub_resource type="DynamicFont" id=1]
[sub_resource type="DynamicFont" id=2]
outline_color = Color( 0, 0, 0, 1 )
use_filter = true
font_data = ExtResource( 1 )

[sub_resource type="PlaneMesh" id=2]
[sub_resource type="PlaneMesh" id=3]
size = Vector2( 2.217, 4 )

[sub_resource type="ViewportTexture" id=3]
[sub_resource type="ViewportTexture" id=4]
flags = 12
viewport_path = NodePath("Viewport")

[sub_resource type="SpatialMaterial" id=4]
[sub_resource type="SpatialMaterial" id=5]
resource_local_to_scene = true
flags_transparent = true
flags_unshaded = true
albedo_texture = SubResource( 3 )
params_use_alpha_scissor = true
params_alpha_scissor_threshold = 0.98
albedo_texture = SubResource( 4 )

[sub_resource type="BoxShape" id=5]
[sub_resource type="BoxShape" id=6]
margin = 0.001
extents = Vector3( 1.109, 0.05, 2 )

Expand Down Expand Up @@ -162,8 +164,8 @@ margin_top = 100.0
margin_right = 90.0
margin_bottom = 141.0
theme = ExtResource( 7 )
custom_styles/normal = SubResource( 6 )
custom_fonts/font = SubResource( 1 )
custom_styles/normal = SubResource( 1 )
custom_fonts/font = SubResource( 2 )
text = "Target Heartrate
80"
align = 1
Expand All @@ -173,12 +175,12 @@ autowrap = true
script = ExtResource( 8 )

[node name="MeshInstance" type="MeshInstance" parent="StaticBody"]
mesh = SubResource( 2 )
material/0 = SubResource( 4 )
mesh = SubResource( 3 )
material/0 = SubResource( 5 )

[node name="CollisionShape" type="CollisionShape" parent="StaticBody"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0339105, 0 )
shape = SubResource( 5 )
shape = SubResource( 6 )

[node name="tl_marker" type="Spatial" parent="StaticBody"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.109, 0, -2 )
Expand Down
3 changes: 1 addition & 2 deletions godot_project/scenes/Level.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ visible = false

[node name="SafetyFence" parent="." instance=ExtResource( 18 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0468838, -2.5273 )
max_allowed_distance = 0.4
deadzone = 0.15
max_allowed_distance = 0.5

[connection signal="timeout" from="spawn_timer" to="spawn_timer" method="_on_spawn_timer_timeout"]
[connection signal="streak_changed" from="cue_emitter" to="." method="_on_cue_emitter_streak_changed"]
Expand Down

0 comments on commit 856ad2f

Please sign in to comment.