diff --git a/godot-git-plugin-v3.1.1/addons/godot-git-plugin/win64/~libgit_plugin.windows.editor.x86_64.dll b/godot-git-plugin-v3.1.1/addons/godot-git-plugin/win64/~libgit_plugin.windows.editor.x86_64.dll new file mode 100644 index 0000000..47bbb1d Binary files /dev/null and b/godot-git-plugin-v3.1.1/addons/godot-git-plugin/win64/~libgit_plugin.windows.editor.x86_64.dll differ diff --git a/scripts/desktop.ini b/scripts/desktop.ini deleted file mode 100644 index 38df78e..0000000 --- a/scripts/desktop.ini +++ /dev/null @@ -1,2 +0,0 @@ -[.ShellClassInfo] -IconResource=C:\Program Files\Google\Drive File Stream\93.0.1.0\GoogleDriveFS.exe,25 diff --git a/scripts/gun.gd b/scripts/gun.gd index 3171147..3792bc9 100644 --- a/scripts/gun.gd +++ b/scripts/gun.gd @@ -55,3 +55,44 @@ func _on_gun_anims_animation_finished(anim_name): player.ammo += player.ammo_reserve player.ammo_reserve -= player.ammo_reserve player.reloading = false + +func shoot(): + if ammo > 0: + if !gun.anim_player.is_playing(): + ammo -= 1 + #RECOIL fix later to happen over a period of time + camera.rotation.x = clamp(lerp(camera.rotation.x, camera.rotation.x + gun.recoil_amount, delta * 10), deg_to_rad(-90), deg_to_rad(60)) + #(ADD PLAYER KICK HERE. RELATIVE TO GUN POSITION) + gun.audio_fire.pitch_scale = 1 + rng.randf_range(-.2,.2) + gun.audio_fire.play() + gun.anim_player.play("shoot") + + # shoot real bullet from camera + if gun_folded == false: + instance_bullet = gun.bullet.instantiate() + instance_bullet.position = bullet_ray.global_position + instance_bullet.transform.basis = bullet_ray.global_transform.basis + instance_bullet.bullet_speed = gun.bullet_speed + instance_bullet.bullet_drop = gun.bullet_drop + instance_bullet.random_spread_amt = gun.random_spread_amt + instance_bullet.gun = gun + get_parent().add_child(instance_bullet) + else: + instance_bullet = gun.bullet.instantiate() + instance_bullet.position = gun.barrel_raycast.global_position + instance_bullet.transform.basis = gun.barrel_raycast.global_transform.basis + instance_bullet.bullet_speed = gun.bullet_speed + instance_bullet.bullet_drop = gun.bullet_drop + instance_bullet.random_spread_amt = gun.random_spread_amt + instance_bullet.gun = gun + get_parent().add_child(instance_bullet) + + # Casing transform + instance_casing = gun.casing.instantiate() + instance_casing.position = gun.casing_ejector.global_position + instance_casing.transform.basis = gun.casing_ejector.global_transform.basis + + get_parent().add_child(instance_casing) + elif !gun.anim_player.is_playing(): + gun.anim_player.play("empty") + gun.audio_empty.play() diff --git a/scripts/player.gd b/scripts/player.gd index 92693f5..d8fe7d1 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -171,45 +171,7 @@ func _physics_process(delta): # Shooting if Input.is_action_pressed("shoot"): - if ammo > 0: - if !gun.anim_player.is_playing(): - ammo -= 1 - #RECOIL fix later to happen over a period of time - camera.rotation.x = clamp(lerp(camera.rotation.x, camera.rotation.x + gun.recoil_amount, delta * 10), deg_to_rad(-90), deg_to_rad(60)) - #(ADD PLAYER KICK HERE. RELATIVE TO GUN POSITION) - gun.audio_fire.pitch_scale = 1 + rng.randf_range(-.2,.2) - gun.audio_fire.play() - gun.anim_player.play("shoot") - - # shoot real bullet from camera - if gun_folded == false: - instance_bullet = gun.bullet.instantiate() - instance_bullet.position = bullet_ray.global_position - instance_bullet.transform.basis = bullet_ray.global_transform.basis - instance_bullet.bullet_speed = gun.bullet_speed - instance_bullet.bullet_drop = gun.bullet_drop - instance_bullet.random_spread_amt = gun.random_spread_amt - instance_bullet.gun = gun - get_parent().add_child(instance_bullet) - else: - instance_bullet = gun.bullet.instantiate() - instance_bullet.position = gun.barrel_raycast.global_position - instance_bullet.transform.basis = gun.barrel_raycast.global_transform.basis - instance_bullet.bullet_speed = gun.bullet_speed - instance_bullet.bullet_drop = gun.bullet_drop - instance_bullet.random_spread_amt = gun.random_spread_amt - instance_bullet.gun = gun - get_parent().add_child(instance_bullet) - - # Casing transform - instance_casing = gun.casing.instantiate() - instance_casing.position = gun.casing_ejector.global_position - instance_casing.transform.basis = gun.casing_ejector.global_transform.basis - - get_parent().add_child(instance_casing) - elif !gun.anim_player.is_playing(): - gun.anim_player.play("empty") - gun.audio_empty.play() + gun.shoot()