summaryrefslogtreecommitdiff
path: root/scripts/ballistics
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/ballistics')
-rw-r--r--scripts/ballistics/Cannonball.gd17
-rw-r--r--scripts/ballistics/NetworkedProjectile.gd29
2 files changed, 0 insertions, 46 deletions
diff --git a/scripts/ballistics/Cannonball.gd b/scripts/ballistics/Cannonball.gd
deleted file mode 100644
index 14de00c..0000000
--- a/scripts/ballistics/Cannonball.gd
+++ /dev/null
@@ -1,17 +0,0 @@
-extends "res://scripts/ballistics/NetworkedProjectile.gd"
-
-export var drag_constant = 0.3
-var damage_exceptions = []
-var oldvel
-
-func _physics_process(_delta):
- oldvel = linear_velocity
- 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, "shooter_id" : shooter_id}
-
-func _on_collision(body):
- if oldvel.length() > 20 and !damage_exceptions.has(body) and body.has_method("damage"):
- body.rpc("damage", oldvel.length(), "blunt", shooter, "using 'cannon'")
- damage_exceptions.append(body)
diff --git a/scripts/ballistics/NetworkedProjectile.gd b/scripts/ballistics/NetworkedProjectile.gd
deleted file mode 100644
index d9304cf..0000000
--- a/scripts/ballistics/NetworkedProjectile.gd
+++ /dev/null
@@ -1,29 +0,0 @@
-extends RigidBody
-
-var shooter = "WORLD"
-var shooter_id = 1
-
-
-# Called when the node enters the scene tree for the first time.
-func _ready():
- pass # Replace with function body.
-
-func mp_init(init_info):
- for variable in init_info.keys():
- set(variable, init_info[variable])
-
-remote func update_phys_transform(t, lv, av):
- transform = t
- linear_velocity = lv
- angular_velocity = 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")