Compare commits

...
This repository has been archived on 2022-01-09. You can view files and clone it, but cannot push or open issues/pull-requests.

2 Commits

Author SHA1 Message Date
unfa bf9eaa1eb0 Substituted Spatial with Node3D 2021-02-26 20:58:13 +01:00
unfa 5036e3e0f4 Fixed player capsule rotation 2021-02-26 20:44:39 +01:00
8 changed files with 109 additions and 44 deletions

View File

@ -1,4 +1,4 @@
extends Spatial
extends Node3D
var first = true
var velocity = 4

View File

@ -1,4 +1,4 @@
extends Spatial
extends Node3D
signal damage_dealt
signal ammo_changed(type, amount)

View File

@ -1,4 +1,4 @@
extends Spatial
extends Node3D
# Declare member variables here. Examples:

View File

@ -1,10 +1,10 @@
extends Spatial
extends Node3D
# This Scene is meant for playing back sound groups. For simple, singular sound effects use stock Godot nodes, this is meant to play a random sound among a group with variations.
const SFX_dir = "res://Assets/SFX/" # all sound clips must reside somewhere in this directory
onready var player = $AudioStreamPlayer3D # playback backend
@onready var player = $AudioStreamPlayer3D # playback backend
export(String, FILE, "*-01.wav") var SoundClip = SFX_dir + "Test-01.wav"
export(bool) var AutoPlay = false

16
Gibs.gd Normal file
View File

@ -0,0 +1,16 @@
extends Node3D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass

View File

@ -1,4 +1,4 @@
extends Spatial
extends Node3D
func on_player_enters(player):
player.rpc("kill")

View File

@ -1,4 +1,4 @@
extends Spatial
extends Node3D
func spawn(player):
player.translation = player.get_parent().to_local(global_transform.origin)

View File

@ -1,106 +1,155 @@
[gd_scene load_steps=10 format=2]
[gd_scene load_steps=17 format=2]
[ext_resource path="res://Player.gd" type="Script" id=1]
[ext_resource path="res://Assets/Weapons/Handgun/Handgun.tscn" type="PackedScene" id=2]
[ext_resource path="res://Assets/HUD/HUD.tscn" type="PackedScene" id=3]
[ext_resource path="res://Billboard.gd" type="Script" id=4]
[ext_resource path="res://Fonts/Roboto_Condensed/RobotoCondensed-Regular-dynamic.tres" type="DynamicFont" id=5]
[ext_resource path="res://Health.tscn" type="PackedScene" id=6]
[ext_resource path="res://Audio/SoundPlayer.gd" type="Script" id=5]
[ext_resource path="" type="PackedScene" id=6]
[ext_resource path="res://Audio/SoundPlayer.tscn" type="PackedScene" id=7]
[ext_resource path="" type="PackedScene" id=8]
[ext_resource path="" type="PackedScene" id=9]
[sub_resource type="QuadMesh" id=1]
size = Vector2( 2, 0.6 )
[sub_resource type="CapsuleShape" id=2]
[sub_resource type="FontData" id=2]
[sub_resource type="Font" id=3]
data/0 = SubResource( 2 )
[sub_resource type="CapsuleShape3D" id=4]
radius = 0.33
height = 1.1
[node name="Player" type="KinematicBody"]
[sub_resource type="PackedScene" id=5]
_bundled = {
"conn_count": 0,
"conns": PackedInt32Array( ),
"editable_instances": [ ],
"names": PackedStringArray( "SoundPlayer", "Spatial", "script", "AudioStreamPlayer3D", "AudioStreamPlayer3D" ),
"node_count": 2,
"node_paths": [ NodePath(".") ],
"nodes": PackedInt32Array( -1, -1, 1, 0, -1, 1, 2, 0, 0, 1073741824, 0, 4, 3, -1, 0, 0 ),
"variants": [ ExtResource( 5 ) ],
"version": 2
}
[sub_resource type="PackedScene" id=6]
_bundled = {
"conn_count": 0,
"conns": PackedInt32Array( ),
"editable_instances": [ ],
"names": PackedStringArray( "SoundPlayer", "Spatial", "script", "AudioStreamPlayer3D", "AudioStreamPlayer3D" ),
"node_count": 2,
"node_paths": [ NodePath(".") ],
"nodes": PackedInt32Array( -1, -1, 1, 0, -1, 1, 2, 0, 0, 1073741824, 0, 4, 3, -1, 0, 0 ),
"variants": [ ExtResource( 5 ) ],
"version": 2
}
[sub_resource type="PackedScene" id=7]
_bundled = {
"conn_count": 0,
"conns": PackedInt32Array( ),
"editable_instances": [ ],
"names": PackedStringArray( "SoundPlayer", "Spatial", "script", "AudioStreamPlayer3D", "AudioStreamPlayer3D" ),
"node_count": 2,
"node_paths": [ NodePath(".") ],
"nodes": PackedInt32Array( -1, -1, 1, 0, -1, 1, 2, 0, 0, 1073741824, 0, 4, 3, -1, 0, 0 ),
"variants": [ ExtResource( 5 ) ],
"version": 2
}
[node name="Player" type="KinematicBody3D"]
script = ExtResource( 1 )
[node name="Camera" type="Camera" parent="."]
[node name="Camera" type="Camera3D" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.53592, -0.0651628 )
script = null
[node name="Hand" type="Spatial" parent="Camera"]
[node name="Hand" type="Node3D" parent="Camera"]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0.335, -0.4, -0.559 )
script = null
[node name="Weapon" parent="Camera/Hand" instance=ExtResource( 2 )]
[node name="Billboard" type="MeshInstance" parent="."]
[node name="Billboard" type="MeshInstance3D" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.49795, 0 )
mesh = SubResource( 1 )
material/0 = null
script = ExtResource( 4 )
[node name="Viewport" type="Viewport" parent="Billboard"]
size = Vector2( 500, 150 )
[node name="Viewport" type="SubViewport" parent="Billboard"]
transparent_bg = true
handle_input_locally = false
hdr = false
usage = 0
render_target_v_flip = true
gui_disable_input = true
size = Vector2i( 500, 150 )
script = null
[node name="VBoxContainer" type="VBoxContainer" parent="Billboard/Viewport"]
margin_right = 500.0
margin_bottom = 111.0
script = null
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Nametag" type="Label" parent="Billboard/Viewport/VBoxContainer"]
margin_right = 500.0
margin_bottom = 50.0
offset_right = 500.0
offset_bottom = 50.0
rect_min_size = Vector2( 500, 50 )
custom_fonts/font = ExtResource( 5 )
custom_fonts/font = SubResource( 3 )
text = "guest"
align = 1
valign = 1
structured_text_bidi_override_options = [ ]
script = null
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Health" parent="Billboard/Viewport/VBoxContainer" instance=ExtResource( 6 )]
anchor_top = 0.0
anchor_bottom = 0.0
margin_left = 0.0
margin_top = 54.0
margin_right = 500.0
margin_bottom = 104.0
[node name="Health" type="MarginContainer" parent="Billboard/Viewport/VBoxContainer"]
offset_top = 54.0
offset_right = 500.0
offset_bottom = 104.0
grow_horizontal = 2
grow_vertical = 2
script = null
__meta__ = {
"_edit_use_anchors_": false
}
[node name="CollisionShapeBody" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, 0, 0.882822, 0 )
shape = SubResource( 2 )
[node name="CollisionShapeBody" type="CollisionShape3D" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.882822, 0 )
shape = SubResource( 4 )
script = null
[node name="Debug" type="Label" parent="."]
margin_right = 41.0
margin_bottom = 14.0
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
text = "Debug"
structured_text_bidi_override_options = [ ]
script = null
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Sounds" type="Spatial" parent="."]
[node name="Sounds" type="Node3D" parent="."]
script = null
[node name="Jump" parent="Sounds" instance=ExtResource( 7 )]
SoundClip = "res://Assets/SFX/Player-Jump-01.wav"
[node name="Footsteps" parent="Sounds" instance=ExtResource( 7 )]
[node name="Footsteps" parent="Sounds" instance=ExtResource( 9 )]
SoundClip = "res://Assets/SFX/Player-Step-Concrete-01.wav"
PlayUntilEnd = true
MinDelay = 0.2
RandomizePitch = 0.2
[node name="Death" parent="Sounds" instance=ExtResource( 7 )]
[node name="Death" parent="Sounds" instance=ExtResource( 8 )]
SoundClip = "res://Assets/SFX/Player-Death-01.wav"
MinDelay = 0.2
[node name="Pain" parent="Sounds" instance=ExtResource( 7 )]
[node name="Pain" parent="Sounds" instance=ExtResource( 6 )]
SoundClip = "res://Assets/SFX/Player-Pain-01.wav"
MinDelay = 0.2
[node name="HUD" parent="." instance=ExtResource( 3 )]
visible = false
[connection signal="ammo_changed" from="Camera/Hand/Weapon" to="HUD" method="update_ammo"]
[connection signal="damage_dealt" from="Camera/Hand/Weapon" to="HUD" method="update_crosshair" binds= [ true, true ]]