OverviewFilesCommitsIssuesDocsReleasesPeers

godot-marble_madness_demo commits / 4524905

mmerrr
45249052bfafda6afdc62710280291c24dbea203
by Dresk Spidflisk <dreskspidflisk@gmail.com> · 2022-02-03T21:44:58.000Z

Changed files (4) +38 -16

levels/level_script.gd +8 -2
……@@ -2,7 +2,7 @@ extends Node
22
33# TODO : Make Debug UI dynamic and not hardcoded in the core Hyper scripts.
44onready var hyperdebugui : Control = $HyperGodotDebugUI
5onready var hyperdebugui_gateway_startstop_button : Button = $HyperGodotDebugUI/HypercoreDebugContainer/GatewayStartStopButton
5onready var hyperdebugui_gateway_startstop_button : Button = $HyperGodotDebugUI/HypercoreDebugPanel/HypercoreDebugContainer/GatewayStartStopButton
66
77onready var gateway : HyperGateway = $HyperGodot/HyperGateway
88onready var gossip : HyperGossip = $HyperGodot/HyperGossip
……@@ -61,6 +61,9 @@ func _on_HyperGateway_started_gateway(_pid : int):
6161 updateGatewayStatus(_pid)
6262 _perform_setup()
6363
64func _on_PlayerLocalNetworkTimer_timeout():
65 _broadcast_player()
66
6467func _on_HyperGateway_stopped_gateway():
6568 updateGatewayStatus(0)
6669
……@@ -104,7 +107,7 @@ func _broadcast_player():
104107 "z": velocity_angular.z
105108 }
106109 }
107 print('Broadcasting', data)
110 # print('Broadcasting', data)
108111 gossip.broadcast_event(EVENT_PLAYER_POSITION, data)
109112
110113func _on_remote_player_moved(positionData, id):
……@@ -122,3 +125,6 @@ func _on_remote_player_moved(positionData, id):
122125 velocity_linear,
123126 velocity_angular
124127 )
128
129func _on_PlayerLocal_moved():
130 _broadcast_player()
levels/scenes/level_0.tscn +5 -1
……@@ -30,6 +30,9 @@ pause_mode = 2
3030script = ExtResource( 8 )
3131player_ball = NodePath("../PlayerLocal")
3232
33[node name="PlayerLocalNetworkTimer" type="Timer" parent="Players"]
34autostart = true
35
3336[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
3437environment = ExtResource( 9 )
3538
……@@ -65,7 +68,8 @@ autoStart = false
6568[node name="HyperGossip" type="Node" parent="HyperGodot"]
6669script = ExtResource( 11 )
6770
68[connection signal="reset_ball" from="Players/PlayerLocal" to="Players/PlayerLocal" method="_on_PlayerLocal_reset_ball"]
71[connection signal="moved" from="Players/PlayerLocal" to="." method="_on_PlayerLocal_moved"]
72[connection signal="timeout" from="Players/PlayerLocalNetworkTimer" to="." method="_on_PlayerLocalNetworkTimer_timeout"]
6973[connection signal="reset_ball" from="special_input" to="Players/PlayerLocal" method="_on_special_input_reset_ball"]
7074[connection signal="toggle_hypergateway_startstop" from="HyperGodotDebugUI" to="HyperGodot/HyperGateway" method="_on_HyperGodotDebugUI_toggle_hypergateway_startstop"]
7175[connection signal="started_gateway" from="HyperGodot/HyperGateway" to="." method="_on_HyperGateway_started_gateway"]
player/ball/player_ball.gd +1 -2
……@@ -7,7 +7,7 @@ enum BallPhysicsMode {
77 PHYSICS_MAX
88}
99
10signal reset_ball()
10signal moved
1111
1212var rolling_force : float = 10.0
1313var rolling_force_max : float = 50.0
……@@ -145,7 +145,6 @@ func _physics_process(delta: float) -> void:
145145 lVelocity.text = String(self.linear_velocity)
146146 lAngularVelocity.text = String(self.angular_velocity)
147147
148
149148func _on_PlayerLocal_reset_ball() -> void:
150149 resetBall()
151150
ui/debug/hypercore/ui_debug_hypercore.tscn +24 -11
……@@ -1,7 +1,10 @@
1[gd_scene load_steps=2 format=2]
1[gd_scene load_steps=3 format=2]
22
33[ext_resource path="res://ui/debug/hypercore/ui_debug_hypercore.gd" type="Script" id=1]
44
5[sub_resource type="StyleBoxFlat" id=1]
6bg_color = Color( 0, 0, 0, 0.470588 )
7
58[node name="Control" type="Control"]
69anchor_right = 1.0
710anchor_bottom = 1.0
……@@ -10,17 +13,27 @@ __meta__ = {
1013"_edit_use_anchors_": false
1114}
1215
13[node name="HypercoreDebugContainer" type="GridContainer" parent="."]
16[node name="HypercoreDebugPanel" type="Panel" parent="."]
1417margin_left = 1052.0
1518margin_top = 62.0
16margin_right = 1591.0
17margin_bottom = 285.0
19margin_right = 1584.0
20margin_bottom = 235.0
21custom_styles/panel = SubResource( 1 )
22__meta__ = {
23"_edit_use_anchors_": false
24}
25
26[node name="HypercoreDebugContainer" type="GridContainer" parent="HypercoreDebugPanel"]
27margin_left = 4.0
28margin_top = 6.0
29margin_right = 543.0
30margin_bottom = 229.0
1831columns = 2
1932__meta__ = {
2033"_edit_use_anchors_": false
2134}
2235
23[node name="GatewayStartStopButton" type="Button" parent="HypercoreDebugContainer"]
36[node name="GatewayStartStopButton" type="Button" parent="HypercoreDebugPanel/HypercoreDebugContainer"]
2437margin_right = 105.0
2538margin_bottom = 20.0
2639text = "Start Gateway"
……@@ -28,7 +41,7 @@ __meta__ = {
2841"_edit_use_anchors_": false
2942}
3043
31[node name="Label" type="Label" parent="HypercoreDebugContainer"]
44[node name="Label" type="Label" parent="HypercoreDebugPanel/HypercoreDebugContainer"]
3245margin_left = 109.0
3346margin_top = 3.0
3447margin_right = 187.0
……@@ -37,7 +50,7 @@ __meta__ = {
3750"_edit_use_anchors_": false
3851}
3952
40[node name="GatewayStatus" type="Label" parent="HypercoreDebugContainer"]
53[node name="GatewayStatus" type="Label" parent="HypercoreDebugPanel/HypercoreDebugContainer"]
4154margin_top = 24.0
4255margin_right = 105.0
4356margin_bottom = 38.0
……@@ -47,7 +60,7 @@ __meta__ = {
4760"_edit_use_anchors_": false
4861}
4962
50[node name="GatewayStatus_Value" type="Label" parent="HypercoreDebugContainer"]
63[node name="GatewayStatus_Value" type="Label" parent="HypercoreDebugPanel/HypercoreDebugContainer"]
5164margin_left = 109.0
5265margin_top = 24.0
5366margin_right = 187.0
……@@ -57,7 +70,7 @@ __meta__ = {
5770"_edit_use_anchors_": false
5871}
5972
60[node name="GossipURL" type="Label" parent="HypercoreDebugContainer"]
73[node name="GossipURL" type="Label" parent="HypercoreDebugPanel/HypercoreDebugContainer"]
6174margin_top = 42.0
6275margin_right = 105.0
6376margin_bottom = 56.0
……@@ -67,11 +80,11 @@ __meta__ = {
6780"_edit_use_anchors_": false
6881}
6982
70[node name="GossipURL_Value" type="Label" parent="HypercoreDebugContainer"]
83[node name="GossipURL_Value" type="Label" parent="HypercoreDebugPanel/HypercoreDebugContainer"]
7184margin_left = 109.0
7285margin_top = 42.0
7386margin_right = 187.0
7487margin_bottom = 56.0
7588text = "N/A"
7689
77[connection signal="button_up" from="HypercoreDebugContainer/GatewayStartStopButton" to="." method="_on_GatewayStartStopButton_button_up"]
90[connection signal="button_up" from="HypercoreDebugPanel/HypercoreDebugContainer/GatewayStartStopButton" to="." method="_on_GatewayStartStopButton_button_up"]