forked from unfa/liblast
Tweaked crosshair hit marker. disabled collision for dead players.
parent
bd1b200964
commit
e18e3cdf0d
|
@ -26,7 +26,7 @@ func _on_Casing_body_entered(body):
|
||||||
|
|
||||||
$AudioStreamPlayer3D.max_db = max(20 - (linear_velocity.length() * 10), 0)
|
$AudioStreamPlayer3D.max_db = max(20 - (linear_velocity.length() * 10), 0)
|
||||||
$AudioStreamPlayer3D.pitch_scale = rand_range(0.98, 1.02)
|
$AudioStreamPlayer3D.pitch_scale = rand_range(0.98, 1.02)
|
||||||
print($AudioStreamPlayer3D.max_db)
|
#print($AudioStreamPlayer3D.max_db)
|
||||||
#$AudioStreamPlayer3D.play()
|
#$AudioStreamPlayer3D.play()
|
||||||
|
|
||||||
collisions += 1
|
collisions += 1
|
||||||
|
|
15
Player.gd
15
Player.gd
|
@ -169,6 +169,9 @@ master func kill():
|
||||||
gibs.global_transform = global_transform
|
gibs.global_transform = global_transform
|
||||||
gibs.show()
|
gibs.show()
|
||||||
|
|
||||||
|
$CollisionShapeBody.disabled = true
|
||||||
|
$CollisionShapeFeet.disabled = true
|
||||||
|
|
||||||
# enable the ragdoll colliders
|
# enable the ragdoll colliders
|
||||||
for i in gibs.get_children():
|
for i in gibs.get_children():
|
||||||
i.get_child(1).disabled = false
|
i.get_child(1).disabled = false
|
||||||
|
@ -178,6 +181,8 @@ master func kill():
|
||||||
is_dead = true
|
is_dead = true
|
||||||
$MeshInstance.hide()
|
$MeshInstance.hide()
|
||||||
$Camera/Hand.hide()
|
$Camera/Hand.hide()
|
||||||
|
$CrosshairContainer.hide()
|
||||||
|
|
||||||
yield(get_tree().create_timer(3), "timeout")
|
yield(get_tree().create_timer(3), "timeout")
|
||||||
|
|
||||||
|
|
||||||
|
@ -204,6 +209,11 @@ func spawn():
|
||||||
$MeshInstance.show()
|
$MeshInstance.show()
|
||||||
$Camera/Hand.show()
|
$Camera/Hand.show()
|
||||||
|
|
||||||
|
$CrosshairContainer.show()
|
||||||
|
|
||||||
|
$CollisionShapeBody.disabled = false
|
||||||
|
$CollisionShapeFeet.disabled = false
|
||||||
|
|
||||||
$Camera.rotation = Vector3.ZERO
|
$Camera.rotation = Vector3.ZERO
|
||||||
rotation = Vector3.ZERO
|
rotation = Vector3.ZERO
|
||||||
|
|
||||||
|
@ -223,12 +233,13 @@ func shoot():
|
||||||
|
|
||||||
if "collider" in result:
|
if "collider" in result:
|
||||||
var hit = result.collider
|
var hit = result.collider
|
||||||
|
|
||||||
if hit.has_method("on_hit"):
|
if hit.has_method("on_hit"):
|
||||||
hit.rpc("on_hit", 30, result.position)
|
hit.rpc("on_hit", 30, result.position)
|
||||||
|
|
||||||
if hit is get_script():
|
if hit is get_script():
|
||||||
print("Is player")
|
print("Is a live player")
|
||||||
|
|
||||||
$CrosshairContainer/HitConfirmation.activate(.2)
|
$CrosshairContainer/HitConfirmation.activate(.2)
|
||||||
|
|
||||||
func _input(event):
|
func _input(event):
|
||||||
|
|
|
@ -76,9 +76,9 @@ anchor_top = 0.5
|
||||||
anchor_right = 0.5
|
anchor_right = 0.5
|
||||||
anchor_bottom = 0.5
|
anchor_bottom = 0.5
|
||||||
margin_left = -511.401
|
margin_left = -511.401
|
||||||
margin_top = -300.757
|
margin_top = -301.225
|
||||||
margin_right = 512.599
|
margin_right = 512.599
|
||||||
margin_bottom = 299.243
|
margin_bottom = 298.775
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
@ -149,6 +149,7 @@ margin_top = -1.0
|
||||||
margin_right = 16.0
|
margin_right = 16.0
|
||||||
margin_bottom = 1.0
|
margin_bottom = 1.0
|
||||||
rect_rotation = 45.3067
|
rect_rotation = 45.3067
|
||||||
|
rect_scale = Vector2( 1, 0.5 )
|
||||||
rect_pivot_offset = Vector2( -8, 1 )
|
rect_pivot_offset = Vector2( -8, 1 )
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
|
@ -160,6 +161,7 @@ margin_top = -1.0
|
||||||
margin_right = 16.0
|
margin_right = 16.0
|
||||||
margin_bottom = 1.0
|
margin_bottom = 1.0
|
||||||
rect_rotation = 135.307
|
rect_rotation = 135.307
|
||||||
|
rect_scale = Vector2( 1, 0.5 )
|
||||||
rect_pivot_offset = Vector2( -8, 1 )
|
rect_pivot_offset = Vector2( -8, 1 )
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
|
@ -171,6 +173,7 @@ margin_top = -1.0
|
||||||
margin_right = 16.0
|
margin_right = 16.0
|
||||||
margin_bottom = 1.0
|
margin_bottom = 1.0
|
||||||
rect_rotation = 225.306
|
rect_rotation = 225.306
|
||||||
|
rect_scale = Vector2( 1, 0.5 )
|
||||||
rect_pivot_offset = Vector2( -8, 1 )
|
rect_pivot_offset = Vector2( -8, 1 )
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
|
@ -182,6 +185,7 @@ margin_top = -1.0
|
||||||
margin_right = 16.0
|
margin_right = 16.0
|
||||||
margin_bottom = 1.0
|
margin_bottom = 1.0
|
||||||
rect_rotation = -44.6931
|
rect_rotation = -44.6931
|
||||||
|
rect_scale = Vector2( 1, 0.5 )
|
||||||
rect_pivot_offset = Vector2( -8, 1 )
|
rect_pivot_offset = Vector2( -8, 1 )
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
|
|
Loading…
Reference in New Issue