Skip to content

Commit

Permalink
Fix Battle mode regression
Browse files Browse the repository at this point in the history
Fix standing cues hand heights
  • Loading branch information
mgschwan committed Jan 1, 2021
1 parent da2d074 commit 28995ec
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 63 deletions.
6 changes: 4 additions & 2 deletions godot_project/BoxmanCharacter.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var mesh_obj

var active = true

var animation_speed = 1.8



Expand Down Expand Up @@ -61,6 +62,7 @@ var animation_queue = []
func _ready():
get_node("EnergyBall").set_as_toplevel(true)
animations = get_node("AnimationPlayer")
animations.playback_speed = animation_speed
for anim in animations.get_animation_list():
animations.get_animation(anim).loop = false
mesh_obj = get_node("Armature/Skeleton/Mesh_0")
Expand Down Expand Up @@ -101,13 +103,13 @@ func play_current_animation(continuous=false):
elif current_animation == BoxmanAnimations.Dying_Middle:
animations.play("dying-loop")
elif current_animation == BoxmanAnimations.Run:
animations.play("running-loop")
animations.play("running-loop",-1, 0.75)
elif current_animation == BoxmanAnimations.Attack_01:
animations.play("attack_01-loop")
elif current_animation == BoxmanAnimations.Defense_01:
animations.play("defense_01-loop")
elif current_animation == BoxmanAnimations.Burpee:
animations.play("burpee-loop")
animations.play("burpee-loop", -1, 0.9)
elif current_animation == BoxmanAnimations.Stand_To_Burpee:
animations.play("idle_to_burpee-loop")
elif current_animation == BoxmanAnimations.Burpee_To_Stand:
Expand Down
1 change: 1 addition & 0 deletions godot_project/Main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ script = ExtResource( 13 )

[node name="SongDatabase" type="Node" parent="."]
script = ExtResource( 15 )

[connection signal="body_entered" from="ARVROrigin/ARVRCamera/AreaHead" to="ARVROrigin/ARVRCamera/AreaHead" method="_on_AreaHead_body_entered"]
[connection signal="timeout" from="ARVROrigin/ARVRCamera/HUDHideTimer" to="ARVROrigin/ARVRCamera" method="_on_HUDHideTimer_timeout"]
[connection signal="timeout" from="DemoTimer" to="." method="_on_DemoTimer_timeout"]
Expand Down
77 changes: 38 additions & 39 deletions godot_project/export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,49 @@ export_filter="all_resources"
include_filter="*.json,*.ogg,*.wav,*.ogv"
exclude_filter=""
export_path="../../../../../../tmp/VRWorkout.apk"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

[preset.0.options]

graphics/32_bits_framebuffer=true
xr_features/xr_mode=1
xr_features/degrees_of_freedom=2
xr_features/hand_tracking=1
xr_features/focus_awareness=false
one_click_deploy/clear_previous_install=false
custom_template/debug=""
custom_template/release=""
custom_template/use_custom_build=false
command_line/extra_args=""
custom_template/export_format=0
architectures/armeabi-v7a=true
architectures/arm64-v8a=true
architectures/x86=false
architectures/x86_64=false
keystore/debug=""
keystore/debug_user=""
keystore/debug_password=""
keystore/release=""
keystore/release_user=""
keystore/release_password=""
one_click_deploy/clear_previous_install=false
version/code=4
version/name="0.9.9n"
package/unique_name="org.godotengine.$genname"
package/name="VRWorkout"
package/signed=true
launcher_icons/main_192x192=""
launcher_icons/adaptive_foreground_432x432=""
launcher_icons/adaptive_background_432x432=""
graphics/32_bits_framebuffer=true
graphics/opengl_debug=false
xr_features/xr_mode=1
xr_features/degrees_of_freedom=2
xr_features/hand_tracking=1
xr_features/focus_awareness=false
screen/immersive_mode=true
screen/orientation=0
screen/support_small=true
screen/support_normal=true
screen/support_large=true
screen/support_xlarge=true
screen/opengl_debug=false
launcher_icons/main_192x192=""
launcher_icons/adaptive_foreground_432x432=""
launcher_icons/adaptive_background_432x432=""
keystore/debug=""
keystore/debug_user=""
keystore/debug_password=""
keystore/release=""
keystore/release_user=""
keystore/release_password=""
command_line/extra_args=""
apk_expansion/enable=false
apk_expansion/SALT=""
apk_expansion/public_key=""
architectures/armeabi-v7a=true
architectures/arm64-v8a=true
architectures/x86=false
architectures/x86_64=false
permissions/custom_permissions=PoolStringArray( )
permissions/access_checkin_properties=false
permissions/access_coarse_location=false
Expand Down Expand Up @@ -209,21 +208,20 @@ export_filter="all_resources"
include_filter="*.json,*.wav,*.webm,*.ogg"
exclude_filter=""
export_path="../../../VRWorkout_win/VRWorkout.exe"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

[preset.1.options]

custom_template/debug=""
custom_template/release=""
binary_format/64_bits=true
binary_format/embed_pck=false
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/64_bits=true
binary_format/embed_pck=false
custom_template/release=""
custom_template/debug=""
codesign/enable=false
codesign/identity=""
codesign/password=""
Expand Down Expand Up @@ -251,18 +249,19 @@ export_filter="all_resources"
include_filter="*.json,*.ogg,*.wav,*.ogv"
exclude_filter=""
export_path="../../../../../../tmp/vrworkout2/index.html"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

[preset.2.options]

custom_template/debug=""
custom_template/release=""
variant/export_type=0
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=true
html/custom_html_shell="res://misc/html/godot.html"
html/head_include=""
custom_template/release=""
custom_template/debug=""
html/full_window_size=true

[preset.3]

Expand All @@ -274,21 +273,22 @@ export_filter="all_resources"
include_filter="*.json,*.ogg,*.wav,*.ogv"
exclude_filter="audio/nonfree_songs/*,audio/songs/cdk*,audio/songs/ffact*,audio/songs/scomber*,audio/songs/04*,*sample.webm,addons/godot_ovrmobile/*"
export_path="../../../../../../tmp/vrworkout/index.html"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

[preset.3.options]

custom_template/debug="/home/developer/Development/godot_workspace/godot.javascript.opt.debug.zip"
custom_template/release="/home/developer/Development/godot_workspace/godot.javascript.opt.zip"
variant/export_type=0
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=true
html/custom_html_shell=""
html/head_include="<script src=\"https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.min.js\"></script>
<script>
var polyfill = new WebXRPolyfill();
</script>"
custom_template/release="/home/developer/Development/godot_workspace/godot.javascript.opt.zip"
custom_template/debug="/home/developer/Development/godot_workspace/godot.javascript.opt.debug.zip"
html/full_window_size=true

[preset.4]

Expand All @@ -300,18 +300,17 @@ export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../../../../../tmp/vrworkout.x86_64"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

[preset.4.options]

custom_template/debug=""
custom_template/release=""
binary_format/64_bits=true
binary_format/embed_pck=false
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/64_bits=true
binary_format/embed_pck=false
custom_template/release=""
custom_template/debug=""
1 change: 1 addition & 0 deletions godot_project/scenes/BattleDisplay.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ transform = Transform( -0.344645, 0.203027, -6.03983e-08, 0.203027, 0.344645, 1.

[node name="GestureInterface" parent="." instance=ExtResource( 8 )]
transform = Transform( 1, -2.2215e-28, 8.47033e-22, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 )

[connection signal="attack_complete" from="PlayerLeft" to="." method="_on_Attack_complete" binds= [ "left" ]]
[connection signal="charge_complete" from="PlayerLeft" to="." method="_on_Attack_charge_complete" binds= [ "left" ]]
[connection signal="attack_complete" from="PlayerRight" to="." method="_on_Attack_complete" binds= [ "right" ]]
Expand Down
25 changes: 13 additions & 12 deletions godot_project/scenes/Level.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,23 @@ _data = {
"tilts": PoolRealArray( 0, 0, 0, 0 )
}

[sub_resource type="PlaneMesh" id=12]
[sub_resource type="PlaneMesh" id=9]
size = Vector2( 4, 2 )

[sub_resource type="SpatialMaterial" id=13]
[sub_resource type="SpatialMaterial" id=10]
albedo_texture = ExtResource( 5 )

[sub_resource type="BoxShape" id=14]
[sub_resource type="BoxShape" id=11]
extents = Vector3( 1.93832, 0.0224054, 1 )

[sub_resource type="BoxShape" id=9]
[sub_resource type="BoxShape" id=12]
extents = Vector3( 0.311419, 0.0926839, 0.161588 )

[sub_resource type="SpatialMaterial" id=10]
[sub_resource type="SpatialMaterial" id=13]
albedo_color = Color( 0.94902, 0.937255, 0.937255, 1 )
albedo_texture = ExtResource( 11 )

[sub_resource type="PlaneMesh" id=11]
[sub_resource type="PlaneMesh" id=14]
size = Vector2( 0.22, 0.13 )

[node name="Main" type="Spatial"]
Expand Down Expand Up @@ -144,12 +144,12 @@ script = ExtResource( 7 )

[node name="MeshInstance" type="MeshInstance" parent="SkipExerciseButton"]
transform = Transform( 1, 0, 2.84217e-14, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
mesh = SubResource( 12 )
material/0 = SubResource( 13 )
mesh = SubResource( 9 )
material/0 = SubResource( 10 )

[node name="CollisionShape" type="CollisionShape" parent="SkipExerciseButton"]
transform = Transform( 1, 0, 8.47033e-22, 0, 1, -1.48847e-22, -3.38813e-21, 5.68434e-14, 1, 0, -0.0253993, 0 )
shape = SubResource( 14 )
shape = SubResource( 11 )

[node name="target" type="Spatial" parent="."]
transform = Transform( 0.118828, 0, 0, 0, 1, 0, 0, 0, 0.0898216, -0.87, 1, -0.0667922 )
Expand All @@ -164,7 +164,7 @@ default_text = "EXIT STAGE"

[node name="CollisionShape" type="CollisionShape" parent="target/exit_button"]
transform = Transform( 1, -3.55271e-15, 2.64698e-23, 0, 1, -1.77636e-15, 3.38813e-21, -2.84217e-14, 1, -0.688979, 0, -0.413249 )
shape = SubResource( 9 )
shape = SubResource( 12 )

[node name="target_zone_l" parent="target" instance=ExtResource( 29 )]
transform = Transform( 4, 0, 0, 0, 0.4, 0, 0, 0, 4, -3.10597, -0.919663, 0.00937921 )
Expand Down Expand Up @@ -207,7 +207,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.026268, -0.001, -0.586 )
[node name="mat_simple" parent="MainStage" instance=ExtResource( 18 )]
transform = Transform( -6.99382e-10, 0, 0.018, 0, 0.02, 0, -0.016, 0, -7.86805e-10, 0.109178, -0.01, 0.493 )
visible = false
material/0 = SubResource( 10 )
material/0 = SubResource( 13 )

[node name="mat" parent="MainStage" instance=ExtResource( 14 )]
transform = Transform( 0.19, 0, 0, 0, 0.2, 0, 0, 0, 0.19, 0.0230895, 0.00996999, 0.522808 )
Expand All @@ -228,8 +228,9 @@ transform = Transform( 0.2, 0, 0, 0, -0.168573, -0.107625, 0, 0.107625, -0.16857

[node name="PushupView" type="MeshInstance" parent="."]
transform = Transform( 10, 0, 0, 0, 8.50029, -5.53584, 0, 5.07871, 8.45678, -0.019583, -0.28405, -0.772499 )
mesh = SubResource( 11 )
mesh = SubResource( 14 )
material/0 = null

[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"]
[connection signal="camera_entered" from="cue_emitter/Position3D/VisibilityNotifier" to="cue_emitter" method="_on_VisibilityNotifier_camera_entered"]
Expand Down
11 changes: 8 additions & 3 deletions godot_project/scenes/TronCharacter.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ material/0 = SubResource( 2 )

[node name="Tween" type="Tween" parent="EnergyBall" index="0"]

[node name="Skeleton" parent="Armature" index="0"]
bones/2/bound_children = [ NodePath("BoneAttachment2") ]
bones/5/bound_children = [ NodePath("BoneAttachment") ]
bones/19/bound_children = [ NodePath("HandAttachment") ]

[node name="Mesh_0" parent="Armature/Skeleton" index="0"]
material/0 = ExtResource( 3 )

[node name="BoneAttachment" type="BoneAttachment" parent="Armature/Skeleton" index="1"]
transform = Transform( 0.986541, -0.152138, -0.0599199, 0.144473, 0.982649, -0.116308, 0.076575, 0.106086, 0.991404, -0.00588353, 0.0848884, 0.00578958 )
transform = Transform( 0.983532, -0.0671211, -0.167806, 0.0374282, 0.983995, -0.174219, 0.176814, 0.16507, 0.970303, -0.00481163, 0.083118, 0.00546106 )
bone_name = "head"

[node name="StaticBody" type="StaticBody" parent="Armature/Skeleton/BoneAttachment" index="0"]
Expand All @@ -47,7 +52,7 @@ transform = Transform( 1, -1.60323e-17, -2.77556e-17, -1.4176e-17, 1, 1.42109e-1
shape = SubResource( 3 )

[node name="BoneAttachment2" type="BoneAttachment" parent="Armature/Skeleton" index="2"]
transform = Transform( 0.563226, -0.224109, -0.795331, -0.0679429, 0.946698, -0.314876, 0.823505, 0.231383, 0.517978, -0.000694645, 0.0664924, -0.000152021 )
transform = Transform( 0.705532, -0.182027, -0.684901, -0.00276611, 0.965735, -0.259515, 0.708672, 0.184991, 0.680854, -0.000720304, 0.0639177, 0.00136709 )
bone_name = "spine_1"

[node name="StaticBody" type="StaticBody" parent="Armature/Skeleton/BoneAttachment2" index="0"]
Expand All @@ -58,7 +63,7 @@ target_area = "torso"
shape = SubResource( 4 )

[node name="HandAttachment" type="BoneAttachment" parent="Armature/Skeleton" index="3"]
transform = Transform( -0.716193, -0.371566, -0.590766, -0.515903, 0.851948, 0.0895987, 0.47001, 0.368949, -0.801852, -0.031513, 0.0797832, -0.00498759 )
transform = Transform( 0.67987, 0.220475, -0.699405, -0.536794, -0.500171, -0.67947, -0.499628, 0.837388, -0.221703, -0.0272466, 0.0560757, -0.00731635 )
bone_name = "right_hand_index_1"

[node name="EnergyShield" parent="Armature/Skeleton/HandAttachment" index="0" instance=ExtResource( 6 )]
Expand Down
10 changes: 5 additions & 5 deletions godot_project/scripts/ExerciseBuilder.gd
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ func setup_cue_parameters(difficulty, ph):
CueSelector.HAND : {
"xoffset" : 0.2,
"xrange" : 0.45,
"yoffset" : -0.2 - difficulty * 0.1,
"yrange" : "0.3+%f*ph/8.0"%difficulty,
"yoffset" : -0.35 - difficulty * 0.1,
"yrange" : "(0.3+%f*ph/8.0)"%difficulty,
"double_swing_spread": "ph/%f"%( 3.0 + (2.0-difficulty)/1.5 ) ,
"invertible_sides": difficulty >= 1.0, #If hands can cross the sides
"windmill": ProjectSettings.get("game/exercise/stand/windmill")
Expand Down Expand Up @@ -828,7 +828,7 @@ func handle_windmill_touch_cues(current_time, target_time, cue_emitter_state, st
windmill_left = (randi()%2 == 0)

var y_hand1 = "ph"
var y_hand2 = "ph*1.2"
var y_hand2 = "ph*1.13"
var y_hand3 = "ph*0.6"

if not windmill_high:
Expand Down Expand Up @@ -860,7 +860,7 @@ func handle_stand_cues_regular(current_time, target_time, cue_emitter_state):
var node_selector = rng.randi()%100

#var y_hand = player_height + cue_parameters[cue_emitter_state][CueSelector.HAND]["yoffset"] + rng.randf() * cue_parameters[cue_emitter_state][CueSelector.HAND]["yrange"]
var y_hand = "ph+%s+%f*%s"%[str(cue_parameters[cue_emitter_state][CueSelector.HAND]["yoffset"]), rng.randf(), str(cue_parameters[cue_emitter_state][CueSelector.HAND]["yrange"])]
var y_hand = "ph+%s+%f*(%s)"%[str(cue_parameters[cue_emitter_state][CueSelector.HAND]["yoffset"]), rng.randf(), str(cue_parameters[cue_emitter_state][CueSelector.HAND]["yrange"])]
var y_head = "ph/1.071+%f"%cue_parameters[cue_emitter_state][CueSelector.HEAD]["yoffset"]

var side = 1.0
Expand Down Expand Up @@ -940,7 +940,7 @@ func handle_squat_cues(current_time, target_time, cue_emitter_state):

var cross_cut_left = false
func handle_squat_cues_cross_cut(current_time, target_time, cue_emitter_state):
var y_hand_up = "ph*1.15"
var y_hand_up = "ph*1.05"
var x_hand_up = "ph*%f"%cue_parameters[cue_emitter_state][CueSelector.HAND]["cross_cut_multiplier"]
var y_hand_down = "ph*0.3"
var x_hand_down = "ph*%f"%cue_parameters[cue_emitter_state][CueSelector.HAND]["cross_cut_multiplier"]
Expand Down
1 change: 1 addition & 0 deletions godot_project/scripts/Level.gd
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func setup_game_data():
battle_module = load("res://scenes/BattleDisplay.tscn").instance()
battle_module.name = "BattleDisplay"
add_child(battle_module)
battle_module.connect("player_won",self,"_on_BattleDisplay_player_won")

cue_emitter.connect("hit_scored", battle_module, "hit_scored")
self.connect("set_exercise", battle_module, "set_exercise")
Expand Down
2 changes: 0 additions & 2 deletions godot_project/scripts/Levelselect.gd
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,6 @@ func update_online_features():
if not GameVariables.FEATURE_MULTIPLAYER and has_node("SettingsCarousel/Connections/ConnectPad"):
get_node("SettingsCarousel/Connections/ConnectPad").queue_free()



func _on_PortalSwitch_toggled(value):
ProjectSettings.set("game/portal_connection", value)
update_online_features()
Expand Down

0 comments on commit 28995ec

Please sign in to comment.