Clean up commented-out bits.

pull/42/head
tokc 2021-03-31 11:58:07 +02:00
parent f648e162fe
commit 7215803015
3 changed files with 21 additions and 6 deletions

View File

@ -324,13 +324,12 @@ func spawn():
rotation = Vector3.ZERO
func shoot():
#var weapon = find_node("Weapon")
# The underscore indicates an unused variable.
# Because it is declared in this scope, it will disappear as soon as the
# function returns. As is, it exists solely to catch the return value of shoot().
var _remaining_ammo = active_weapon.shoot($Camera)
func reload():
#var weapon = find_node("Weapon")
active_weapon.reload()
func _input(event):

View File

@ -138,7 +138,7 @@ script = ExtResource( 8 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.53592, -0.0651628 )
[node name="Hand" type="Spatial" parent="Camera"]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0.335, -0.393079, -0.559 )
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0.335, -0.39118, -0.559 )
[node name="WeaponBobAnimationTree" type="AnimationTree" parent="Camera/Hand"]
tree_root = SubResource( 12 )

View File

@ -13,9 +13,15 @@ _global_script_classes=[ {
"class": "Player",
"language": "GDScript",
"path": "res://Classes/Player/Player.gd"
}, {
"base": "Spatial",
"class": "Weapon",
"language": "GDScript",
"path": "res://Assets/Weapons/Weapon.gd"
} ]
_global_script_class_icons={
"Player": ""
"Player": "",
"Weapon": ""
}
[application]
@ -90,6 +96,16 @@ MoveJetpack={
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"unicode":0,"echo":false,"script":null)
]
}
NextWeapon={
"deadzone": 0.5,
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":4,"pressed":false,"doubleclick":false,"script":null)
]
}
PrevWeapon={
"deadzone": 0.5,
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":5,"pressed":false,"doubleclick":false,"script":null)
]
}
[rendering]