OverviewFilesCommitsIssuesDocsReleasesPeers

godot-tumble_player_demo commits / 18db076

Updated multiplayer (boy this is a mess)
18db076339cd5b1e2b1a01b5f5b9d0eda1e1d144
by Dresk Spidflisk <dreskspidflisk@gmail.com> · 2022-03-17T00:04:26.000Z

Changed files (6) +100 -19

TPS_controller_3.3/TPS_core_player.tscn +88 -0
……@@ -0,0 +1,88 @@
1[gd_scene load_steps=26 format=2]
2
3[ext_resource path="res://TPS_controller_3.3/new_player_state_local.gd" type="Script" id=1]
4[ext_resource path="res://player/models/tumble_asset2.tscn" type="PackedScene" id=4]
5[ext_resource path="res://player/models/tumble/landing.tres" type="Animation" id=7]
6[ext_resource path="res://player/models/tumble/jump.tres" type="Animation" id=8]
7[ext_resource path="res://player/models/tumble/sprint-loop.tres" type="Animation" id=9]
8[ext_resource path="res://player/models/tumble/run-loop.tres" type="Animation" id=10]
9[ext_resource path="res://player/models/tumble/falling-loop.tres" type="Animation" id=11]
10[ext_resource path="res://player/models/tumble/default.tres" type="Animation" id=12]
11[ext_resource path="res://player/models/tumble/idle-loop.tres" type="Animation" id=13]
12[ext_resource path="res://player/models/tumble/dive-roll.tres" type="Animation" id=14]
13[ext_resource path="res://player/models/tumble/walk-diagonal-left-back-loop.tres" type="Animation" id=15]
14[ext_resource path="res://player/models/tumble/strafe-right-loop.tres" type="Animation" id=16]
15[ext_resource path="res://player/models/tumble/strafe-left-loop.tres" type="Animation" id=17]
16[ext_resource path="res://player/models/tumble/walk-backward-loop.tres" type="Animation" id=18]
17[ext_resource path="res://player/models/tumble/wall_grab_r-loop.tres" type="Animation" id=19]
18[ext_resource path="res://player/models/tumble/walk-diagonal-right-loop.tres" type="Animation" id=20]
19[ext_resource path="res://player/models/tumble/walk-diagonal-right-back-loop.tres" type="Animation" id=21]
20[ext_resource path="res://player/models/tumble/walk-diagonal-left-loop.tres" type="Animation" id=22]
21[ext_resource path="res://player/models/tumble/wall_grab_f-loop.tres" type="Animation" id=23]
22[ext_resource path="res://player/models/tumble/walk-forward-loop.tres" type="Animation" id=24]
23[ext_resource path="res://player/models/tumble/wall_grab_l-loop.tres" type="Animation" id=25]
24[ext_resource path="res://player/models/tumble/wall_run_r-loop.tres" type="Animation" id=26]
25[ext_resource path="res://player/models/tumble/wall_run_l-loop.tres" type="Animation" id=27]
26[ext_resource path="res://player/player_local_core.tres" type="AnimationNodeBlendTree" id=28]
27
28[sub_resource type="CylinderShape" id=1]
29radius = 0.3
30height = 1.57511
31
32[node name="Player" type="KinematicBody"]
33collision_layer = 2
34script = ExtResource( 1 )
35
36[node name="CollisionShape" type="CollisionShape" parent="."]
37transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.787508, 0 )
38shape = SubResource( 1 )
39
40[node name="Mesh" type="Spatial" parent="."]
41
42[node name="tumble" parent="Mesh" instance=ExtResource( 4 )]
43transform = Transform( 0.65, 0, 0, 0, 0.65, 0, 0, 0, 0.65, 0, 0, 0 )
44
45[node name="AnimationPlayer2" type="AnimationPlayer" parent="."]
46root_node = NodePath("../Mesh/tumble")
47anims/default = ExtResource( 12 )
48anims/dive-roll = ExtResource( 14 )
49anims/falling-loop = ExtResource( 11 )
50anims/idle-loop = ExtResource( 13 )
51anims/jump = ExtResource( 8 )
52anims/landing = ExtResource( 7 )
53anims/run-loop = ExtResource( 10 )
54anims/sprint-loop = ExtResource( 9 )
55anims/strafe-left-loop = ExtResource( 17 )
56anims/strafe-right-loop = ExtResource( 16 )
57anims/walk-backward-loop = ExtResource( 18 )
58anims/walk-diagonal-left-back-loop = ExtResource( 15 )
59anims/walk-diagonal-left-loop = ExtResource( 22 )
60anims/walk-diagonal-right-back-loop = ExtResource( 21 )
61anims/walk-diagonal-right-loop = ExtResource( 20 )
62anims/walk-forward-loop = ExtResource( 24 )
63anims/wall_grab_f-loop = ExtResource( 23 )
64anims/wall_grab_l-loop = ExtResource( 25 )
65anims/wall_grab_r-loop = ExtResource( 19 )
66anims/wall_run_l-loop = ExtResource( 27 )
67anims/wall_run_r-loop = ExtResource( 26 )
68
69[node name="AnimationTree" type="AnimationTree" parent="."]
70tree_root = ExtResource( 28 )
71anim_player = NodePath("../AnimationPlayer2")
72active = true
73parameters/Blend2/blend_amount = 0.0
74"parameters/Blend2 2/blend_amount" = 0.0
75"parameters/TimeScale 3/scale" = 1.0
76parameters/aim_transition/current = 0
77parameters/air_blend/blend_amount = 1.0
78parameters/air_transition/current = 0
79parameters/falling_scale/scale = 1.0
80parameters/iwr_blend/blend_amount = -1.0
81parameters/jump_scale/scale = 1.0
82parameters/landing_scale/scale = 1.0
83parameters/roll/active = false
84parameters/roll_scale/scale = 1.0
85parameters/run_scale/scale = 1.0
86parameters/strafe/blend_position = Vector2( 0.0673628, 1.37838 )
87parameters/walk_scale/scale = 1.0
88parameters/wall_run/current = 2
TPS_controller_3.3/TPS_new_remote_player.tscn +2 -4
……@@ -1,5 +1,3 @@
1[gd_scene load_steps=2 format=2]
1[gd_scene format=2]
22
3[ext_resource path="res://TPS_controller_3.3/TPS_core_player.tscn" type="PackedScene" id=1]
4
5[node name="Player" instance=ExtResource( 1 )]
3[node name="Player"]
TPS_controller_3.3/new_player_collisionui.tscn +0 -3
……@@ -9,9 +9,6 @@ bg_color = Color( 0, 0, 0, 0.470588 )
99anchor_right = 1.0
1010anchor_bottom = 1.0
1111script = ExtResource( 1 )
12__meta__ = {
13"_edit_use_anchors_": false
14}
1512
1613[node name="Panel" type="Panel" parent="."]
1714margin_left = 10.0
TPS_controller_3.3/new_player_state_local.gd +1 -1
……@@ -194,7 +194,7 @@ func _checkPlayerCanJump(newBody : PhysicsBody, addedBody : bool) -> void:
194194func _on_Player_body_entered(body : Node) -> void:
195195 if(!collisions.has(body.get_instance_id()) ):
196196 collisions[body.get_instance_id()] = body.name
197 $CollisionUI.onNewCollision(body, collisions)
197 $CollisionUI.onNewollision(body, collisions)
198198
199199
200200func _on_Player_body_exited(body : Node) -> void:
levels/level_script.gd +8 -10
……@@ -1,10 +1,8 @@
11extends Node
22
3onready var hyperGateway : HyperGateway = $HyperGodot/HyperGateway
4onready var gossip : HyperGossip = $HyperGodot/HyperGossip
5onready var gossip_event_timer : Timer = $HyperGodot/GossipEventTimer
6
7onready var player_local : KinematicBody = $Players/PlayerLocal
3onready var hyperGateway : HyperGateway
4onready var hyperGossip : HyperGossip
5onready var player_local : KinematicBody
86
97const knownPlayers = {}
108
……@@ -17,9 +15,11 @@ var RemotePlayer = preload("res://TPS_controller_3.3/TPS_new_remote_player.tscn"
1715
1816func _ready():
1917 if !hyperGateway:
20 hyperGateway = $HyperGodot/HyperGateway
18 hyperGateway = get_node("../HyperGodot/HyperGateway")
2119 if !player_local:
22 player_local = $Players/PlayerLocal
20 player_local = get_node("../Players/PlayerLocal")
21 if !hyperGossip:
22 hyperGossip = get_node("../HyperGodot/HyperGossip")
2323
2424func _on_GossipEventTimer_timeout():
2525 if hyperGateway.getIsGatewayRunning():
……@@ -36,8 +36,6 @@ func get_player_object(id):
3636
3737 var remotePlayer = RemotePlayer.instance()
3838 knownPlayers[id] = remotePlayer
39
40 emit_signal("new_player")
4139
4240 add_child(remotePlayer)
4341 _broadcast_player_snapshot()
……@@ -63,7 +61,7 @@ func _broadcast_player_snapshot():
6361 }
6462 }
6563 # print('Broadcasting', data)
66 gossip.broadcast_event(EVENT_PLAYER_SNAPSHOT, data)
64 hyperGossip.broadcast_event(EVENT_PLAYER_SNAPSHOT, data)
6765
6866func on_remote_player_snapshot(positionData, id):
6967 var remotePlayer = get_player_object(id)
player/player_local_core.tres +1 -1
……@@ -187,4 +187,4 @@ nodes/walk_scale/node = SubResource( 23 )
187187nodes/walk_scale/position = Vector2( -640, 360 )
188188nodes/wall_run/node = SubResource( 50 )
189189nodes/wall_run/position = Vector2( 720, -60 )
190node_connections = [ "output", 0, "wall_run", "falling_scale", 0, "Animation 6", "TimeScale 3", 0, "strafe", "Blend2 2", 0, "Animation 11", "Blend2 2", 1, "Animation 10", "Blend2", 0, "Animation 8", "Blend2", 1, "Animation 9", "air_blend", 0, "jump_scale", "air_blend", 1, "falling_scale", "air_blend", 2, "landing_scale", "aim_transition", 0, "TimeScale 3", "aim_transition", 1, "iwr_blend", "air_transition", 0, "air_blend", "air_transition", 1, "aim_transition", "iwr_blend", 0, "Animation 2", "iwr_blend", 1, "walk_scale", "iwr_blend", 2, "run_scale", "run_scale", 0, "Animation 4", "landing_scale", 0, "Animation 7", "roll_scale", 0, "Animation", "jump_scale", 0, "jump", "walk_scale", 0, "Animation 3", "wall_run", 0, "Blend2", "wall_run", 1, "Blend2 2", "wall_run", 2, "roll", "roll", 0, "air_transition", "roll", 1, "roll_scale" ]
190node_connections = [ "output", 0, "wall_run", "wall_run", 0, "Blend2", "wall_run", 1, "Blend2 2", "wall_run", 2, "roll", "TimeScale 3", 0, "strafe", "roll_scale", 0, "Animation", "Blend2", 0, "Animation 8", "Blend2", 1, "Animation 9", "air_blend", 0, "jump_scale", "air_blend", 1, "falling_scale", "air_blend", 2, "landing_scale", "air_transition", 0, "air_blend", "air_transition", 1, "aim_transition", "aim_transition", 0, "TimeScale 3", "aim_transition", 1, "iwr_blend", "falling_scale", 0, "Animation 6", "iwr_blend", 0, "Animation 2", "iwr_blend", 1, "walk_scale", "iwr_blend", 2, "run_scale", "landing_scale", 0, "Animation 7", "Blend2 2", 0, "Animation 11", "Blend2 2", 1, "Animation 10", "walk_scale", 0, "Animation 3", "roll", 0, "air_transition", "roll", 1, "roll_scale", "jump_scale", 0, "jump", "run_scale", 0, "Animation 4" ]