Merge branch 'main' of https://github.com/MarcEricMartel/FirstPersonSlapper
This commit is contained in:
commit
14e14d5929
32
HUD.tscn
32
HUD.tscn
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=10 format=2]
|
[gd_scene load_steps=9 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://SlapGauge.gd" type="Script" id=1]
|
[ext_resource path="res://SlapGauge.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://Start.gd" type="Script" id=2]
|
[ext_resource path="res://Start.gd" type="Script" id=2]
|
||||||
@ -51,11 +51,6 @@ shader_param/kill = null
|
|||||||
shader_param/bkgcol = Plane( 0, 0, 0, 0.3 )
|
shader_param/bkgcol = Plane( 0, 0, 0, 0.3 )
|
||||||
shader_param/kilcol = Plane( 0.5, 0, 0, 0.3 )
|
shader_param/kilcol = Plane( 0.5, 0, 0, 0.3 )
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=12]
|
|
||||||
size = 33
|
|
||||||
use_filter = true
|
|
||||||
font_data = ExtResource( 3 )
|
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=7]
|
[sub_resource type="DynamicFont" id=7]
|
||||||
size = 88
|
size = 88
|
||||||
outline_size = 5
|
outline_size = 5
|
||||||
@ -67,33 +62,30 @@ font_data = ExtResource( 3 )
|
|||||||
follow_viewport_enable = true
|
follow_viewport_enable = true
|
||||||
|
|
||||||
[node name="ActualHUD" type="Control" parent="."]
|
[node name="ActualHUD" type="Control" parent="."]
|
||||||
|
anchor_left = 0.037
|
||||||
|
anchor_top = 0.914
|
||||||
|
anchor_right = 0.037
|
||||||
|
anchor_bottom = 0.916
|
||||||
margin_right = 40.0
|
margin_right = 40.0
|
||||||
margin_bottom = 40.0
|
margin_bottom = 40.0
|
||||||
theme = SubResource( 8 )
|
theme = SubResource( 8 )
|
||||||
|
|
||||||
[node name="SlapGauge" type="ColorRect" parent="ActualHUD"]
|
[node name="SlapGauge" type="ColorRect" parent="ActualHUD"]
|
||||||
material = SubResource( 11 )
|
material = SubResource( 11 )
|
||||||
anchor_left = 12.875
|
margin_right = 291.36
|
||||||
anchor_top = 7.625
|
margin_bottom = 23.0
|
||||||
anchor_right = 12.875
|
|
||||||
anchor_bottom = 7.625
|
|
||||||
margin_left = -464.0
|
|
||||||
margin_top = 666.0
|
|
||||||
margin_right = 114.0
|
|
||||||
margin_bottom = 699.0
|
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
[node name="SlapLabel" type="Label" parent="ActualHUD"]
|
[node name="SlapLabel" type="Label" parent="ActualHUD/SlapGauge"]
|
||||||
modulate = Color( 1, 1, 1, 0.611765 )
|
modulate = Color( 1, 1, 1, 0.611765 )
|
||||||
anchor_left = 12.662
|
anchor_left = 12.662
|
||||||
anchor_top = 7.324
|
anchor_top = 7.324
|
||||||
anchor_right = 12.662
|
anchor_right = 12.662
|
||||||
anchor_bottom = 7.324
|
anchor_bottom = 7.324
|
||||||
margin_left = -441.48
|
margin_left = -3683.2
|
||||||
margin_top = 673.04
|
margin_top = -169.452
|
||||||
margin_right = -380.48
|
margin_right = -3572.2
|
||||||
margin_bottom = 712.04
|
margin_bottom = -137.452
|
||||||
custom_fonts/font = SubResource( 12 )
|
|
||||||
text = "Slap"
|
text = "Slap"
|
||||||
|
|
||||||
[node name="Start" type="Control" parent="."]
|
[node name="Start" type="Control" parent="."]
|
||||||
|
16
Player.gd
16
Player.gd
@ -24,13 +24,15 @@ var gravity_vec = Vector3()
|
|||||||
|
|
||||||
onready var head = $Head
|
onready var head = $Head
|
||||||
onready var ground_check = $GroundCheck
|
onready var ground_check = $GroundCheck
|
||||||
onready var SlapGauge = $HUD/ActualHUD/SlapGauge
|
onready var slap_gauge = $HUD/ActualHUD/SlapGauge
|
||||||
|
onready var slap_animator = $HandMovement
|
||||||
onready var Menu = $HUD/Start
|
onready var Menu = $HUD/Start
|
||||||
onready var AudioSlap = $AudioSlap
|
onready var AudioSlap = $AudioSlap
|
||||||
onready var AudioMegaSlap = $AudioMegaSlap
|
onready var AudioMegaSlap = $AudioMegaSlap
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
pass
|
slap_animator.current_animation = "basic_slap"
|
||||||
|
|
||||||
|
|
||||||
func _input(event):
|
func _input(event):
|
||||||
if event is InputEventMouseMotion:
|
if event is InputEventMouseMotion:
|
||||||
@ -97,8 +99,11 @@ func _physics_process(delta):
|
|||||||
else:
|
else:
|
||||||
slap -= delta * 8.0;
|
slap -= delta * 8.0;
|
||||||
slap = clamp(slap, 0.0, 1.0)
|
slap = clamp(slap, 0.0, 1.0)
|
||||||
SlapGauge.fill = slap;
|
|
||||||
SlapGauge.kill = slapkill;
|
slap_gauge.fill = slap
|
||||||
|
slap_animator.seek(slap, true)
|
||||||
|
slap_gauge.fill = slap;
|
||||||
|
slap_gauge.kill = slapkill;
|
||||||
|
|
||||||
|
|
||||||
direction = direction.normalized()
|
direction = direction.normalized()
|
||||||
@ -107,4 +112,7 @@ func _physics_process(delta):
|
|||||||
movement.x = h_velocity.x + gravity_vec.x
|
movement.x = h_velocity.x + gravity_vec.x
|
||||||
movement.y = gravity_vec.y
|
movement.y = gravity_vec.y
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# warning-ignore:return_value_discarded
|
||||||
move_and_slide(movement, Vector3.UP)
|
move_and_slide(movement, Vector3.UP)
|
||||||
|
85
Player.tscn
85
Player.tscn
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=10 format=2]
|
[gd_scene load_steps=12 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://Player.gd" type="Script" id=1]
|
[ext_resource path="res://Player.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://BlenderStuff/Hand/protohand.obj" type="ArrayMesh" id=2]
|
[ext_resource path="res://BlenderStuff/Hand/protohand.obj" type="ArrayMesh" id=2]
|
||||||
@ -13,9 +13,76 @@ height = 3.0
|
|||||||
[sub_resource type="CylinderShape" id=3]
|
[sub_resource type="CylinderShape" id=3]
|
||||||
|
|
||||||
[sub_resource type="SpatialMaterial" id=4]
|
[sub_resource type="SpatialMaterial" id=4]
|
||||||
|
flags_no_depth_test = true
|
||||||
albedo_texture = ExtResource( 3 )
|
albedo_texture = ExtResource( 3 )
|
||||||
uv1_triplanar = true
|
uv1_triplanar = true
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id=5]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/path = NodePath("Head/HandParent/Hand:transform")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PoolRealArray( 0 ),
|
||||||
|
"transitions": PoolRealArray( 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ Transform( -0.178665, 0.385633, 0.0293721, 0.386578, 0.177103, 0.0262457, 0.0115471, 0.0376593, -0.4242, 1.33036, -0.0718137, -2.73514 ) ]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/path = NodePath("Head/HandParent/Hand:translation")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PoolRealArray( 0 ),
|
||||||
|
"transitions": PoolRealArray( 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ Vector3( 0.329, 1.317, 0 ) ]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/path = NodePath("Head/HandParent/Hand:rotation_degrees")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PoolRealArray( 0 ),
|
||||||
|
"transitions": PoolRealArray( 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ Vector3( -20.757, 0, 0 ) ]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id=6]
|
||||||
|
resource_name = "basic_slap"
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/path = NodePath("Head/HandParent/Hand:translation")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PoolRealArray( 0, 1 ),
|
||||||
|
"transitions": PoolRealArray( 1, 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ Vector3( 0, 0, 0 ), Vector3( -0.103, 2.756, 0 ) ]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/path = NodePath("Head/HandParent/Hand:rotation_degrees")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PoolRealArray( 0, 1 ),
|
||||||
|
"transitions": PoolRealArray( 1, 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ Vector3( 0, 0, 0 ), Vector3( -36.146, -1.281, 0 ) ]
|
||||||
|
}
|
||||||
|
|
||||||
[node name="Player" type="KinematicBody"]
|
[node name="Player" type="KinematicBody"]
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
@ -31,13 +98,17 @@ shape = SubResource( 3 )
|
|||||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.84218, 0 )
|
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.84218, 0 )
|
||||||
|
|
||||||
[node name="Camera" type="Camera" parent="Head"]
|
[node name="Camera" type="Camera" parent="Head"]
|
||||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.343071, -0.253136 )
|
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0154071, 0.355, -0.246618 )
|
||||||
|
fov = 80.0
|
||||||
|
|
||||||
[node name="Hand" type="MeshInstance" parent="Head"]
|
[node name="HandParent" type="Spatial" parent="Head"]
|
||||||
transform = Transform( -0.178665, 0.385633, 0.029372, 0.386578, 0.177104, 0.0262457, 0.0115471, 0.0376592, -0.4242, 1.33036, -0.0718137, -2.73514 )
|
transform = Transform( 0.0807126, 0.49343, -0.00351894, 0.445393, -0.0713166, 0.215728, 0.212391, -0.0379586, -0.451053, 0.736, -0.075, -1.998 )
|
||||||
|
|
||||||
|
[node name="Hand" type="MeshInstance" parent="Head/HandParent"]
|
||||||
|
transform = Transform( 0.426025, 0, 0, 0, 0.398372, 0.150985, 0, -0.150985, 0.398372, 0.329, 1.317, 0 )
|
||||||
cast_shadow = 0
|
cast_shadow = 0
|
||||||
mesh = ExtResource( 2 )
|
mesh = ExtResource( 2 )
|
||||||
skeleton = NodePath("../..")
|
skeleton = NodePath("../../..")
|
||||||
material/0 = SubResource( 4 )
|
material/0 = SubResource( 4 )
|
||||||
|
|
||||||
[node name="GroundCheck" type="RayCast" parent="."]
|
[node name="GroundCheck" type="RayCast" parent="."]
|
||||||
@ -47,6 +118,10 @@ cast_to = Vector3( 0, -1.5, 0 )
|
|||||||
|
|
||||||
[node name="HUD" parent="." instance=ExtResource( 4 )]
|
[node name="HUD" parent="." instance=ExtResource( 4 )]
|
||||||
|
|
||||||
|
[node name="HandMovement" type="AnimationPlayer" parent="."]
|
||||||
|
anims/RESET = SubResource( 5 )
|
||||||
|
anims/basic_slap = SubResource( 6 )
|
||||||
|
|
||||||
[node name="AudioSlap" type="AudioStreamPlayer3D" parent="."]
|
[node name="AudioSlap" type="AudioStreamPlayer3D" parent="."]
|
||||||
stream = ExtResource( 5 )
|
stream = ExtResource( 5 )
|
||||||
bus = "SFX"
|
bus = "SFX"
|
||||||
|
@ -18,7 +18,9 @@ config/icon="res://icon.png"
|
|||||||
|
|
||||||
window/size/width=1920
|
window/size/width=1920
|
||||||
window/size/height=1080
|
window/size/height=1080
|
||||||
window/size/fullscreen=true
|
window/size/test_width=1280
|
||||||
|
window/size/test_height=720
|
||||||
|
window/stretch/mode="viewport"
|
||||||
window/stretch/aspect="keep"
|
window/stretch/aspect="keep"
|
||||||
|
|
||||||
[gui]
|
[gui]
|
||||||
|
Loading…
Reference in New Issue
Block a user