diff options
| author | Anson Bridges <bridges.anson@gmail.com> | 2022-09-02 23:12:33 -0700 |
|---|---|---|
| committer | Anson Bridges <bridges.anson@gmail.com> | 2022-09-02 23:12:33 -0700 |
| commit | 4d51178d32e07c070c61aa7567856bec7eda3639 (patch) | |
| tree | 7ef4884dd2221340f9c1ed96bd0f52c761ae9fb0 /scripts/ballistics | |
| parent | 0939d84e611f1c63fd5805339a2f777251fb1653 (diff) | |
hit/killsounds, swimming, main menu, fixed explosion physics
Diffstat (limited to 'scripts/ballistics')
| -rw-r--r-- | scripts/ballistics/Cannonball.gd | 2 | ||||
| -rw-r--r-- | scripts/ballistics/NetworkedProjectile.gd | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/scripts/ballistics/Cannonball.gd b/scripts/ballistics/Cannonball.gd index 15f35a3..7b56577 100644 --- a/scripts/ballistics/Cannonball.gd +++ b/scripts/ballistics/Cannonball.gd @@ -9,7 +9,7 @@ func _physics_process(_delta): add_force(-1*linear_velocity*drag_constant, Vector3.ZERO) func get_init_info(): - return {"linear_velocity" : linear_velocity, "angular_velocity" : angular_velocity, "oldvel" : oldvel, "shooter" : shooter} + return {"linear_velocity" : linear_velocity, "angular_velocity" : angular_velocity, "oldvel" : oldvel, "shooter" : shooter, "shooter_id" : shooter_id} func _on_collision(body): if linear_velocity.length() > 20 and !damage_exceptions.has(body) and body.has_method("damage"): diff --git a/scripts/ballistics/NetworkedProjectile.gd b/scripts/ballistics/NetworkedProjectile.gd index 0626e9f..d9304cf 100644 --- a/scripts/ballistics/NetworkedProjectile.gd +++ b/scripts/ballistics/NetworkedProjectile.gd @@ -1,7 +1,7 @@ extends RigidBody - var shooter = "WORLD" +var shooter_id = 1 # Called when the node enters the scene tree for the first time. @@ -20,3 +20,10 @@ remote func update_phys_transform(t, lv, av): func _integrate_forces(state): if is_network_master(): rpc("update_phys_transform", transform, linear_velocity, angular_velocity) + +remotesync func net_remove(): + queue_free() + +func net_master_remove(): + if is_network_master(): + rpc("net_remove") |
