more stuff

This commit is contained in:
Amazed 2021-10-01 15:50:16 +02:00
parent 0904ce843f
commit 211881fcfb
61 changed files with 274 additions and 244 deletions

Binary file not shown.

View File

@ -16,6 +16,7 @@ nodes/root_name="Scene Root"
nodes/root_scale=1.0 nodes/root_scale=1.0
nodes/custom_script="" nodes/custom_script=""
nodes/storage=0 nodes/storage=0
nodes/use_legacy_names=true
materials/location=1 materials/location=1
materials/storage=1 materials/storage=1
materials/keep_on_reimport=true materials/keep_on_reimport=true
@ -29,8 +30,8 @@ external_files/store_in_subdir=false
animation/import=true animation/import=true
animation/fps=15 animation/fps=15
animation/filter_script="" animation/filter_script=""
animation/storage=false animation/storage=1
animation/keep_custom_tracks=false animation/keep_custom_tracks=true
animation/optimizer/enabled=true animation/optimizer/enabled=true
animation/optimizer/max_linear_error=0.05 animation/optimizer/max_linear_error=0.05
animation/optimizer/max_angular_error=0.01 animation/optimizer/max_angular_error=0.01

View File

@ -40,7 +40,7 @@ blend_point_4/node = SubResource( 7 )
blend_point_4/pos = Vector2( 0, -1 ) blend_point_4/pos = Vector2( 0, -1 )
[sub_resource type="AnimationNodeBlendTree" id=9] [sub_resource type="AnimationNodeBlendTree" id=9]
graph_offset = Vector2( -30, 21 ) graph_offset = Vector2( 0, 65.5 )
"nodes/Animation 2/node" = SubResource( 1 ) "nodes/Animation 2/node" = SubResource( 1 )
"nodes/Animation 2/position" = Vector2( 20, 340 ) "nodes/Animation 2/position" = Vector2( 20, 340 )
nodes/blend_draw/node = SubResource( 2 ) nodes/blend_draw/node = SubResource( 2 )
@ -118,13 +118,16 @@ visible = false
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, 0 ) transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, 0 )
[node name="lefthand" type="BoneAttachment" parent="Armature/Skeleton" index="1"] [node name="lefthand" type="BoneAttachment" parent="Armature/Skeleton" index="1"]
transform = Transform( 0.594281, 0.0448764, -0.803004, -0.579132, 0.716685, -0.388547, 0.558064, 0.695951, 0.451902, -1.33227, 5.06098, 1.35674 ) transform = Transform( 0.564253, 0.0541211, -0.823825, -0.598574, 0.714068, -0.363064, 0.568618, 0.697981, 0.435311, -1.42826, 5.04108, 1.28101 )
bone_name = "left_hand_index_4" bone_name = "left_hand_index_4"
[node name="righthand" type="BoneAttachment" parent="Armature/Skeleton" index="2"] [node name="righthand" type="BoneAttachment" parent="Armature/Skeleton" index="2"]
transform = Transform( -0.0755415, -0.687611, -0.722138, 0.159813, -0.723194, 0.6719, -0.984252, -0.0646502, 0.16452, 0.847641, 5.08798, -0.4881 ) transform = Transform( -0.0680855, -0.709655, -0.70125, 0.192445, -0.699023, 0.688717, -0.978942, -0.0880606, 0.184163, 0.900404, 5.11416, -0.448968 )
bone_name = "right_hand_index_2" bone_name = "right_hand_index_2"
[node name="AnimationPlayer" parent="." index="9"]
playback_speed = 0.2
[node name="AnimationTree" type="AnimationTree" parent="." index="10"] [node name="AnimationTree" type="AnimationTree" parent="." index="10"]
tree_root = SubResource( 9 ) tree_root = SubResource( 9 )
anim_player = NodePath("../AnimationPlayer") anim_player = NodePath("../AnimationPlayer")

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

38
characters/mecc.tscn Normal file
View File

@ -0,0 +1,38 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://entities/character.gd" type="Script" id=1]
[ext_resource path="res://assets/all_gbs/mc_l0.gbs.obj" type="ArrayMesh" id=2]
[sub_resource type="CapsuleShape" id=1]
radius = 3.0
height = 5.0
[node name="Mecc" type="KinematicBody"]
script = ExtResource( 1 )
max_weapons = 4
[node name="lefthand" type="BoneAttachment" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 5, 8, -1 )
[node name="Skeleton" type="Skeleton" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0 )
[node name="MeshInstance" type="MeshInstance" parent="Skeleton"]
mesh = ExtResource( 2 )
material/0 = null
material/1 = null
material/2 = null
material/3 = null
material/4 = null
material/5 = null
material/6 = null
material/7 = null
material/8 = null
material/9 = null
material/10 = null
material/11 = null
material/12 = null
[node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 5.5, 0 )
shape = SubResource( 1 )

View File

@ -1,6 +1,29 @@
extends Character extends Character
func _ready(): func _ready():
footstep_sounds = {
GroundType.DIRT: [
preload("res://assets/audio/Sounds/SR_FSDI1.xx_reaperlev1.gzp.wav"),
preload("res://assets/audio/Sounds/SR_FSDI2.xx_reaperlev1.gzp.wav")
],
GroundType.GRASS: [
preload("res://assets/audio/Sounds/SR_FSGR1.xx_reaperlev1.gzp.wav"),
preload("res://assets/audio/Sounds/SR_FSGR2.xx_reaperlev1.gzp.wav"),
],
GroundType.METAL: [
preload("res://assets/audio/Sounds/SR_FSMT1.xx_reaperlev1.gzp.wav"),
preload("res://assets/audio/Sounds/SR_FSMT2.xx_reaperlev1.gzp.wav"),
],
GroundType.SAND: [
preload("res://assets/audio/Sounds/SR_FSSA1.xx_reaperlev1.gzp.wav"),
preload("res://assets/audio/Sounds/SR_FSSA2.xx_reaperlev1.gzp.wav"),
],
GroundType.WATER: [
preload("res://assets/audio/Sounds/SR_FSWA1.xx_reaperlev1.gzp.wav"),
preload("res://assets/audio/Sounds/SR_FSWA2.xx_reaperlev1.gzp.wav"),
]
}
var _weap var _weap
_weap = pickup_weapon(create_weapon(preload("res://weapons/sword.tscn"))) _weap = pickup_weapon(create_weapon(preload("res://weapons/sword.tscn")))
_weap = pickup_weapon(create_weapon(preload("res://weapons/bow.tscn"))) _weap = pickup_weapon(create_weapon(preload("res://weapons/bow.tscn")))
@ -8,3 +31,8 @@ func _ready():
_weap = pickup_weapon(create_weapon(preload("res://weapons/proximitymissile.tscn"))) _weap = pickup_weapon(create_weapon(preload("res://weapons/proximitymissile.tscn")))
set_weapon_slot(0) set_weapon_slot(0)
connect("jumped", self, "jumped")
func jumped():
var jump_sound = preload("res://assets/audio/Sounds/SR_FLYEN.xx_raik.gzp.wav")
Globals.play_sound(jump_sound, Globals.Bus.Sounds, self)

View File

@ -1,41 +1,47 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=6 format=2]
[ext_resource path="res://characters/reaper.gd" type="Script" id=1] [ext_resource path="res://characters/reaper.gd" type="Script" id=1]
[ext_resource path="res://characters/latest_reaper/Reaper.tscn" type="PackedScene" id=2] [ext_resource path="res://characters/latest_reaper/Reaper.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/audio/Sounds/MS_SPLA1.xx_permanentaliens.gzp.wav" type="AudioStream" id=3] [ext_resource path="res://assets/audio/Sounds/MS_SPLA1.xx_permanentaliens.gzp.wav" type="AudioStream" id=3]
[ext_resource path="res://characters/latest_reaper/standing run forward-loop.anim" type="Animation" id=6]
[sub_resource type="CapsuleShape" id=1] [sub_resource type="CapsuleShape" id=1]
radius = 3.0 radius = 3.0
height = 4.0 height = 4.0
[node name="Reaper" type="KinematicBody"] [node name="Reaper" type="KinematicBody"]
collision/safe_margin = 2.0 collision_layer = 2
script = ExtResource( 1 ) script = ExtResource( 1 )
weapon_refpt_right = NodePath("Reaper/Armature/Skeleton/righthand") weapon_refpt_right = NodePath("ReaperGLTF/Armature/Skeleton/righthand")
weapon_refpt_left = NodePath("Reaper/Armature/Skeleton/lefthand") weapon_refpt_left = NodePath("ReaperGLTF/Armature/Skeleton/lefthand")
water_splash_sound = ExtResource( 3 ) water_splash_sound = ExtResource( 3 )
animation_tree_path = NodePath("Reaper/AnimationTree") animation_tree_path = NodePath("ReaperGLTF/AnimationTree")
sprint_speed = 250.0 sprint_speed = 250.0
deacceleration = 10 deacceleration = 6
jump_height = 60 air_control = 0.05
gravity = 96.0 jump_height = 65
walk_speed = 100.0 gravity = 200.0
walk_speed = 45.0
[node name="MeshInstance" type="MeshInstance" parent="."]
[node name="CollisionShape" type="CollisionShape" parent="."] [node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 5, 0 ) transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 5, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="Reaper" parent="." instance=ExtResource( 2 )] [node name="ReaperGLTF" parent="." instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.611, 0 )
[node name="lefthand" parent="Reaper/Armature/Skeleton" index="1"] [node name="lefthand" parent="ReaperGLTF/Armature/Skeleton" index="1"]
transform = Transform( 0.498628, 0.154997, -0.852846, -0.67193, 0.690685, -0.267328, 0.547613, 0.70635, 0.448543, -1.61223, 5.10315, 1.16548 ) transform = Transform( 0.532954, 0.0959757, -0.840684, -0.651193, 0.680928, -0.335089, 0.540284, 0.726034, 0.425402, -1.56225, 5.06134, 1.12064 )
[node name="righthand" parent="Reaper/Armature/Skeleton" index="2"] [node name="righthand" parent="ReaperGLTF/Armature/Skeleton" index="2"]
transform = Transform( 0.258578, -0.407099, -0.876018, 0.146213, -0.879917, 0.45207, -0.95486, -0.24498, -0.168004, 1.20192, 5.03102, -0.110304 ) transform = Transform( 0.227042, -0.513301, -0.827631, 0.0755038, -0.837989, 0.540437, -0.970953, -0.185191, -0.151503, 1.15032, 5.00594, -0.0259017 )
[node name="AnimationTree" parent="Reaper" index="10"] [node name="AnimationTree" parent="ReaperGLTF" index="10"]
parameters/movement/blend_position = Vector2( 0, 0 ) parameters/movement/blend_position = Vector2( 0, 0 )
[editable path="Reaper"] [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
root_node = NodePath("../ReaperGLTF")
playback_speed = 0.2
"anims/standing run forward-loop" = ExtResource( 6 )
[editable path="ReaperGLTF"]

View File

@ -1,157 +0,0 @@
[gd_scene load_steps=23 format=2]
[ext_resource path="res://assets/all_gbs/vp_l1.gbs.obj" type="ArrayMesh" id=1]
[ext_resource path="res://assets/audio/Sounds/VI_INJR1.xx_vimp.gzp.wav" type="AudioStream" id=2]
[ext_resource path="res://characters/vimp2.gd" type="Script" id=3]
[ext_resource path="res://assets/all_gbs/VimpFoodChunk1.gbs.obj" type="ArrayMesh" id=4]
[sub_resource type="ConvexPolygonShape" id=1]
points = PoolVector3Array( 1.53143, -1.46073, 10.949, 1.64665, -3.61804, 13.2137, 1.64665, -3.61804, 13.3922, 1.64665, 2.79855, 10.719, 1.64665, 3.51182, 13.2137, 1.65343, 3.4847, 13.382, 1.82494, -3.61804, 13.2137, 1.82494, -3.61804, 13.3922, 1.82494, 3.51182, 13.3922, 2.00324, 3.33315, 13.3922, 2.03807, 2.94616, 10.8061, 2.83522, -0.94519, 13.1715, 2.89404, -1.29958, 10.719, 3.07216, 1.90732, 13.2137, 3.09314, -0.885743, 11.1531, 3.14136, -1.4108, 11.6785, 3.25046, 2.44192, 12.6791, 3.25046, 2.61989, 10.719, 3.26665, -0.780903, 12.5655, 3.28465, -0.948612, 12.4288, 3.42894, 1.55069, 12.5009, 3.42894, 1.72935, 12.1445 )
[sub_resource type="ConvexPolygonShape" id=2]
points = PoolVector3Array( 1.52756, 0.17178, 10.8175, 1.56864, 0.217404, 10.9181, 1.64663, 2.44234, 9.47044, 1.64663, 2.79848, 10.7188, 1.825, 1.55076, 6.61989, 1.825, 2.9768, 10.7188, 1.825, 3.51175, 6.61989, 2.00321, 1.01727, 6.61989, 2.00321, 3.69006, 7.15437, 2.35963, -0.409257, 8.40189, 2.35963, 0.125692, 7.51069, 2.53753, 3.69006, 7.33253, 2.68451, 2.76848, 10.4792, 2.71574, -1.12203, 10.0053, 2.71574, -0.587085, 8.58004, 2.71574, 0.838957, 6.61989, 2.71574, 3.69006, 6.61989, 2.71574, 3.69006, 6.97621, 2.89395, -1.30084, 10.7188, 2.89395, 1.37244, 6.61989, 2.89395, 3.15511, 6.61989, 3.07216, -1.30084, 10.7188, 3.07216, -1.12203, 10.1835, 3.07216, 1.72907, 7.51069, 3.07216, 2.08571, 7.51069, 3.25053, 2.08571, 10.0053, 3.25053, 2.44234, 9.82716, 3.25053, 2.44234, 10.7188 )
[sub_resource type="ConvexPolygonShape" id=3]
points = PoolVector3Array( 1.64656, -5.04381, 11.2535, 1.64656, -5.04381, 12.1447, 1.64656, -4.50934, 11.4317, 1.64656, -4.50934, 12.323, 1.82486, -4.86598, 12.323, 2.00307, -4.50934, 12.1447, 2.00307, -4.33103, 11.2535, 2.18111, -5.57875, 10.897, 2.18111, -4.33103, 10.897, 2.5377, -5.57875, 10.897, 2.5377, -5.57875, 11.4317, 2.5377, -4.50934, 11.2535 )
[sub_resource type="ConvexPolygonShape" id=4]
points = PoolVector3Array( 2.00296, -7.53906, 11.0754, 2.00296, -7.00441, 11.4317, 2.18125, -7.71736, 11.0754, 2.18125, -6.29195, 11.6099, 2.18125, -5.57875, 11.0754, 2.18125, -5.57875, 11.4317, 2.35963, -7.89566, 11.6099, 2.5377, -5.9356, 11.6099, 2.5377, -5.57875, 10.897, 2.5377, -5.57875, 11.4317, 2.71578, -8.07396, 11.2536, 2.71578, -7.00441, 11.0754, 2.89416, -7.00441, 11.9665, 3.07244, -7.18271, 11.9665, 3.07244, -6.82636, 11.4317 )
[sub_resource type="ConvexPolygonShape" id=5]
points = PoolVector3Array( -1.20547, -5.2209, 11.6093, -1.17718, 4.28523, 13.343, -1.09053, 2.94448, 11.5519, -1.0892, -5.0797, 13.189, -1.03913, -2.42288, 9.63775, -1.01842, -0.550807, 9.96788, -0.871182, -2.72631, 9.33796, -0.855718, -0.864305, 9.66727, -0.740179, 2.04237, 10.7373, -0.492486, -7.18161, 13.2141, -0.492486, -7.18161, 13.3925, -0.41083, -2.11014, 8.68735, -0.3141, -7.36007, 13.2141, -0.270772, -3.60781, 8.60381, -0.109185, -3.78639, 8.58922, -0.101118, -1.96104, 8.64568, -0.0959594, 0.260418, 9.31539, 0.0259917, -7.70673, 13.6223, 0.059671, 0.612665, 9.44873, 0.2205, -3.69354, 8.68209, 0.37688, -3.51298, 8.70596, 0.379727, -2.11621, 8.66608, 0.871129, 3.88756, 12.8483, 1.25142, 4.18987, 13.3025, 1.46809, -5.57781, 13.3925, 1.55549, 3.52546, 13.2332, 1.64647, -5.04244, 11.6093, 1.84817, 2.18223, 10.694, 1.89513, 1.4509, 9.85053 )
[sub_resource type="ConvexPolygonShape" id=6]
points = PoolVector3Array( -1.74021, -8.07421, 11.4324, -1.74021, -8.07421, 11.7876, -1.74021, -3.79584, 13.3925, -1.74021, 0.659629, 9.82753, -1.74021, 1.01626, 9.82753, -1.74021, 4.04642, 13.2141, -1.5619, -8.07421, 11.7876, -1.5619, -7.71757, 11.2541, -1.5619, 1.01626, 9.82753, -1.38379, -5.04283, 13.3925, -1.38379, -2.19099, 9.82753, -1.38379, 3.8681, 12.3229, -1.38379, 4.40305, 13.0358, -1.24729, -1.83558, 10.106, -1.23807, -0.27056, 10.3577, -1.23554, 2.11863, 11.294, -1.22712, 3.07946, 11.9372, -1.22158, 4.02842, 12.9502, -1.20982, 4.30285, 13.3638, -1.20552, -7.53926, 11.2541, -1.20552, -7.53926, 11.4324, -1.20552, -5.04283, 13.3925 )
[sub_resource type="ConvexPolygonShape" id=7]
points = PoolVector3Array( -3.34443, -1.12149, 12.1442, -3.34443, -0.76493, 11.431, -3.34443, 2.44209, 10.3617, -3.34443, 2.62038, 11.075, -3.2666, 2.38689, 12.2582, -3.25075, -0.965484, 12.5239, -3.16604, -1.29977, 11.9659, -3.16604, 2.08553, 8.22394, -2.98782, 1.37241, 6.79807, -2.98782, 2.62038, 6.61975, -2.94185, 1.57267, 13.0424, -2.93947, -0.976531, 13.0243, -2.80959, 1.01584, 6.61975, -2.80959, 3.51178, 6.61975, -2.6312, -0.76493, 8.93654, -2.6312, -0.408367, 8.22394, -2.6312, 0.65928, 6.79807, -2.6312, 3.69006, 7.1547, -2.27506, -0.408367, 8.22394, -2.09683, 0.837561, 6.61975, -1.9186, -3.26155, 13.2135, -1.9186, -3.26155, 13.3918, -1.9186, 1.37241, 6.61975, -1.9186, 3.51178, 6.61975, -1.9186, 3.69006, 13.3918, -1.74021, -3.26155, 13.2135, -1.74021, 2.08553, 8.40225, -1.74021, 2.26381, 8.58057, -1.74021, 3.69006, 13.2135, -1.74021, 3.69006, 13.3918, -1.71403, -3.375, 13.5023, -1.64974, -2.06571, 11.5917 )
[sub_resource type="ConvexPolygonShape" id=8]
points = PoolVector3Array( -2.4532, -7.36087, 11.7882, -2.4532, -7.18254, 12.1447, -2.0967, -7.18254, 12.1447, -1.91846, -8.07421, 11.4318, -1.91846, -5.75752, 11.0753, -1.91846, -4.68785, 11.0753, -1.91846, -4.68785, 11.4318, -1.74021, -8.07421, 11.7882, -1.74021, -7.18254, 11.2536, -1.74021, -6.64787, 11.9663, -1.74021, -4.68785, 11.0753, -1.74021, -4.68785, 11.4318 )
[sub_resource type="ConvexPolygonShape" id=9]
points = PoolVector3Array( 1.82472, 1.5514, 6.61909, 1.82472, 2.26425, 5.90591, 1.82472, 3.3332, 6.26211, 2.00316, 1.01692, 3.94539, 2.00316, 1.01692, 6.61909, 2.00316, 1.37335, 3.94539, 2.00316, 2.97678, 5.37096, 2.00316, 3.86831, 6.61909, 2.18123, 0.838556, 3.94539, 2.18123, 3.86831, 6.08414, 2.35967, 0.660187, 4.12388, 2.35967, 0.838556, 6.61909, 2.35967, 1.72977, 3.94539, 2.35967, 3.86831, 6.61909, 2.53749, 3.68963, 5.90591, 2.71593, 0.838556, 3.94539, 2.71593, 0.838556, 6.61909, 2.71593, 1.72977, 3.94539, 2.71593, 3.68963, 6.08414, 2.89401, 3.3332, 6.61909, 3.07244, 1.37335, 4.83706, 3.07244, 1.72977, 4.65857, 3.07244, 1.72977, 6.61909, 3.07244, 2.79841, 6.4406 )
[sub_resource type="ConvexPolygonShape" id=10]
points = PoolVector3Array( 2.18121, -0.231307, 1.80647, 2.18121, 0.303398, 1.62819, 2.18121, 0.659803, 3.94539, 2.18121, 1.55111, 3.94539, 2.35946, 1.37281, 3.23204, 2.5377, -0.409606, 1.62819, 2.5377, -0.409606, 1.80647, 2.71595, 0.481696, 1.62819, 2.71595, 0.659803, 3.94539, 2.71595, 1.55111, 3.5886, 2.71595, 1.55111, 3.94539, 2.8942, -0.409606, 1.62819, 2.8942, 0.481696, 1.80647 )
[sub_resource type="ConvexPolygonShape" id=11]
points = PoolVector3Array( 1.64661, -1.47908, -0.154277, 1.64661, -1.30059, -0.154277, 1.64661, -1.12228, 1.09341, 1.64661, 0.30338, 0.736956, 1.64661, 0.30338, 1.09341, 1.82498, -1.47908, 0.914923, 2.00307, -0.587852, -0.154277, 2.1813, -0.231569, 1.62819, 2.35953, 0.30338, 0.914923, 2.35953, 0.30338, 1.62819, 2.71585, -0.587852, -0.154277, 2.89407, -0.587852, 1.62819, 2.89407, 0.30338, 1.62819, 3.0723, -1.47908, -0.154277, 3.0723, -1.47908, 0.914923, 3.0723, -0.0534268, 0.914923, 3.0723, -0.0534268, 1.27156 )
[sub_resource type="ConvexPolygonShape" id=12]
points = PoolVector3Array( 1.46845, -4.33044, 0.0239872, 1.46845, -4.33044, 0.380253, 1.46845, -2.90556, -0.154207, 1.46845, -2.7274, 0.380253, 1.46845, -2.01436, -0.154207, 1.64672, -1.47949, -0.154207, 1.82498, -3.44004, 0.915202, 1.82498, -3.26188, 0.915202, 1.82498, -1.47949, 0.736764, 2.35977, -4.15228, -0.332523, 2.53804, -3.79596, -0.332523, 2.71562, -5.57835, 0.202303, 2.71562, -5.39979, -0.154207, 2.71562, -4.33044, -0.332523, 3.07215, -1.47949, 0.736764, 3.25041, -3.6178, 0.915202, 3.25041, -2.90556, 0.915202, 3.25041, -1.47949, -0.154207, 3.42867, -1.65805, -0.154207, 3.60694, -3.08372, 0.55857, 3.60694, -2.01436, -0.154207, 3.60694, -2.01436, 0.202303, 3.78543, -5.22163, 0.0239872, 3.78543, -5.22163, 0.202303, 3.78543, -4.68716, 0.380253 )
[sub_resource type="ConvexPolygonShape" id=13]
points = PoolVector3Array( -3.16618, 1.72965, 6.4406, -3.16618, 2.08614, 5.72779, -2.98775, 1.9079, 5.01517, -2.98775, 3.15503, 6.2623, -2.98775, 3.15503, 6.61909, -2.80967, 1.01666, 4.65838, -2.80967, 1.01666, 6.61909, -2.80967, 1.9079, 4.65838, -2.63123, 0.838713, 6.61909, -2.63123, 2.44204, 4.83687, -2.63123, 3.68977, 5.90589, -2.63123, 3.68977, 6.61909, -2.27497, 0.838713, 5.72779, -2.27497, 0.838713, 6.61909, -2.27497, 2.26439, 4.65838, -2.0969, 1.01666, 4.65838, -2.0969, 1.9079, 4.65838, -2.0969, 2.79853, 5.19327, -2.0969, 3.68977, 6.61909, -2.0969, 3.86831, 6.2623, -2.0969, 3.86831, 6.4406, -1.91846, 1.37316, 5.19327, -1.91846, 1.37316, 6.61909, -1.91846, 2.44204, 5.37157, -1.91846, 3.51152, 6.61909 )
[sub_resource type="ConvexPolygonShape" id=14]
points = PoolVector3Array( -2.80969, -0.766099, 1.45026, -2.80969, 0.303537, 1.45026, -2.80969, 0.837701, 4.47968, -2.80969, 1.01593, 4.65838, -2.80969, 1.72885, 4.30129, -2.63144, -0.766099, 1.45026, -2.63144, -0.766099, 1.62833, -2.63144, 1.72885, 3.94483, -2.63144, 1.9076, 4.65838, -2.27495, 0.303537, 1.45026, -2.27495, 0.659472, 1.9851, -2.27495, 0.837701, 4.65838, -2.27495, 1.9076, 4.30129, -2.0967, -0.23115, 1.9851, -2.0967, 0.125308, 1.62833, -2.0967, 0.837701, 4.47968, -2.0967, 1.55062, 3.94483, -2.0967, 1.72885, 4.65838 )
[sub_resource type="ConvexPolygonShape" id=15]
points = PoolVector3Array( -3.16618, -1.65733, -0.154032, -3.16618, -1.47903, -0.154032, -2.9878, -1.65733, 0.914993, -2.9878, -1.12243, 1.27145, -2.80957, -0.944328, 1.44994, -2.80957, -0.765837, -0.332523, -2.80957, 0.125081, 1.09331, -2.80957, 0.125081, 1.44994, -2.63134, -1.12243, -0.332523, -2.63134, -0.588114, -0.332523, -2.2752, -0.588114, -0.332523, -2.09681, -0.409623, 1.44994, -2.09681, 0.30338, 1.44994, -1.91874, -1.65733, 0.914993, -1.91874, -0.765837, -0.332523, -1.91874, 0.30338, 0.736677, -1.74035, -1.65733, -0.154032, -1.74035, -1.65733, 0.380567, -1.74035, 0.30338, 1.27145, -1.56197, 0.125081, 1.09331, -1.56197, 0.30338, 0.914993 )
[sub_resource type="ConvexPolygonShape" id=16]
points = PoolVector3Array( -3.70092, -4.68707, 0.0240396, -3.70092, -4.68707, 0.55857, -3.52243, -2.1928, 0.202216, -3.52243, -2.01431, -0.154242, -3.1659, -3.79577, 0.736956, -3.1659, -1.65771, -0.154242, -3.1659, -1.65771, 0.736956, -2.63111, -5.57875, -0.154242, -2.63111, -4.86556, -0.332523, -2.45353, -5.57875, 0.202216, -2.45353, -4.86556, -0.332523, -2.097, -3.61804, 0.736956, -2.097, -3.44032, -0.332523, -1.91874, -1.65771, 0.736956, -1.74047, -3.97387, 0.55857, -1.74047, -1.65771, -0.154242, -1.74047, -1.65771, 0.55857, -1.56221, -1.83621, -0.154242, -1.38395, -4.50858, 0.0240396, -1.38395, -4.50858, 0.202216, -1.38395, -3.08334, -0.154242, -1.38395, -2.37053, 0.0240396 )
[sub_resource type="ConvexPolygonShape" id=17]
points = PoolVector3Array( -2.97217, 1.17238, 17.1127, -2.95236, 1.15202, 16.614, -2.63899, 1.17386, 18.9522, -2.60065, -1.5063, 17.9316, -2.58321, 0.623359, 13.859, -2.57598, -0.531189, 18.5734, -2.48126, 3.70522, 16.2761, -2.42685, -1.22184, 13.8622, -2.28955, 0.656057, 19.2704, -2.18018, 4.30892, 18.6561, -2.15555, 2.88781, 13.5741, -1.68452, 5.40573, 15.4005, -1.58573, -2.64374, 18.8846, -1.56134, -7.35996, 16.7788, -1.5069, 4.69367, 14.0306, -1.46433, 4.16988, 13.61, -1.45886, 3.64855, 19.6035, -1.45275, 0.149889, 19.7568, -1.34532, 5.78598, 16.4335, -1.33994, 5.75437, 16.9508, -1.27886, -7.58759, 15.3008, -0.810314, -8.79291, 15.9311, -0.670977, -8.43014, 16.9565, -0.645115, 3.80281, 19.8539, -0.472044, -9.14437, 14.4001, -0.466844, 3.53667, 19.9691, -0.303874, -9.37141, 15.5813, -0.303796, 5.52541, 18.148, -0.302346, -7.45385, 13.545, -0.295191, -8.61931, 13.8012, -0.136028, -8.60825, 17.1348, -0.128534, -3.14067, 19.0638, 0.371135, 3.51882, 19.9585, 0.380083, 5.34306, 18.3168, 0.381272, -9.37827, 15.5802, 0.39831, -9.14257, 13.5715, 0.39831, -8.43014, 17.1348, 0.529655, 0.306803, 19.9101, 0.540534, 0.850621, 19.9692, 0.556761, 5.75739, 17.2961, 0.722883, 3.81136, 19.8586, 1.04461, -8.38456, 16.444, 1.23452, 3.80291, 19.683, 1.24696, 5.75541, 16.4349, 1.24971, 4.38802, 13.4949, 1.35798, -6.95803, 15.2924, 1.36448, -5.48852, 13.6249, 1.49264, -2.80711, 18.8853, 1.50348, -0.366614, 19.7159, 1.5306, 0.82048, 19.7672, 1.57445, 5.33096, 15.4148, 1.5769, 5.17098, 14.8997, 1.74596, 4.82445, 18.1445, 1.88545, 3.20524, 13.5866, 2.06453, 4.07555, 18.8058, 2.32562, -1.99767, 18.4154, 2.38684, -1.0985, 13.9766, 2.51211, 1.11084, 13.8323, 2.51652, -1.99945, 18.1016, 2.54444, 1.17358, 18.9526, 2.65786, -1.83558, 16.4514, 2.6927, -1.66963, 17.2767, 2.72844, 1.86425, 16.7788, 2.8818, 1.17585, 16.7788 )
[sub_resource type="ParticlesMaterial" id=18]
flag_align_y = true
direction = Vector3( 0, 1, 0 )
initial_velocity = 10.0
angular_velocity = 120.0
angle = 180.0
angle_random = 1.0
[node name="Character" type="KinematicBody"]
script = ExtResource( 3 )
[node name="MeshInstance" type="MeshInstance" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
mesh = ExtResource( 1 )
material/0 = null
material/1 = null
material/2 = null
[node name="CollisionShape17" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 1 )
[node name="CollisionShape16" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 2 )
[node name="CollisionShape15" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 3 )
[node name="CollisionShape14" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 4 )
[node name="CollisionShape13" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 5 )
[node name="CollisionShape12" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 6 )
[node name="CollisionShape11" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 7 )
[node name="CollisionShape10" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 8 )
[node name="CollisionShape9" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 9 )
[node name="CollisionShape8" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 10 )
[node name="CollisionShape7" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 11 )
[node name="CollisionShape6" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 12 )
[node name="CollisionShape5" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 13 )
[node name="CollisionShape4" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 14 )
[node name="CollisionShape3" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 15 )
[node name="CollisionShape2" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 16 )
[node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 0, 0 )
shape = SubResource( 17 )
[node name="HitSound" type="AudioStreamPlayer3D" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 16.2275, 0 )
stream = ExtResource( 2 )
unit_db = 30.0
autoplay = true
[node name="Particles" type="Particles" parent="."]
visible = false
amount = 1
lifetime = 2.0
explosiveness = 1.0
process_material = SubResource( 18 )
draw_pass_1 = ExtResource( 4 )

View File

@ -1,12 +1,12 @@
[gd_resource type="AudioBusLayout" format=2] [gd_resource type="AudioBusLayout" format=2]
[resource] [resource]
bus/0/volume_db = -5.625 bus/0/volume_db = 1.45601
bus/1/name = "Music" bus/1/name = "Music"
bus/1/solo = false bus/1/solo = false
bus/1/mute = false bus/1/mute = false
bus/1/bypass_fx = false bus/1/bypass_fx = false
bus/1/volume_db = 0.0 bus/1/volume_db = -80.0
bus/1/send = "Master" bus/1/send = "Master"
bus/2/name = "Ambiants" bus/2/name = "Ambiants"
bus/2/solo = false bus/2/solo = false
@ -18,5 +18,5 @@ bus/3/name = "Sounds"
bus/3/solo = false bus/3/solo = false
bus/3/mute = false bus/3/mute = false
bus/3/bypass_fx = false bus/3/bypass_fx = false
bus/3/volume_db = 0.0 bus/3/volume_db = 6.02
bus/3/send = "Master" bus/3/send = "Master"

View File

@ -9,9 +9,19 @@ enum States {
enum GroundType { enum GroundType {
DIRT, DIRT,
WATER, WATER,
WOOD WOOD,
METAL,
SAND,
GRASS
} }
signal health_changed
signal died
signal changed_weapon
signal fired(projectile)
signal pickup_weapon
signal jumped
var UI: Control var UI: Control
export var max_weapons: int = 5 export var max_weapons: int = 5
var weapons: Array = [] var weapons: Array = []
@ -34,20 +44,17 @@ const FLOOR_NORMAL := Vector3.UP
export var sprint_speed := 16.0 export var sprint_speed := 16.0
export var acceleration := 8 export var acceleration := 8
export var deacceleration := 100 export var deacceleration := 100
export(float, 0.0, 1.0, 0.05) var air_control := 0.3 export(float, 0.0, 1.0, 0.00001) var air_control := 0.001
export var can_jump = true
export var jump_height := 5 export var jump_height := 5
export var floor_max_angle := 45.0 export var floor_max_angle := 90.0
export var gravity: float = 40.0 export var gravity: float = 40.0
export var walk_speed: float = 2.0 export var walk_speed: float = 2.0
export var ground_friction: float = 3.0
var ground_type = GroundType.DIRT var ground_type = GroundType.DIRT
var footstep_sounds = { var footstep_sounds = {}
GroundType.DIRT: [
preload("res://assets/audio/Sounds/SR_FSDI1.xx_reaperlev1.gzp.wav"),
preload("res://assets/audio/Sounds/SR_FSDI2.xx_reaperlev1.gzp.wav")
]
}
export var health = 100 export var health = 100
var state = States.Alive var state = States.Alive
@ -85,6 +92,7 @@ func pickup_weapon(weapon: Weapon) -> Weapon:
func take_damage(hitpts: float): func take_damage(hitpts: float):
health -= hitpts health -= hitpts
emit_signal("health_changed")
if health <= 0: if health <= 0:
die() die()
@ -93,6 +101,7 @@ func get_current_weapon():
func die(): func die():
state = States.Dead state = States.Dead
emit_signal("died")
func set_weapon_slot(slot: int): func set_weapon_slot(slot: int):
if current_weapon: if current_weapon:
@ -103,8 +112,9 @@ func set_weapon_slot(slot: int):
current_weapon.play_switch_sound() current_weapon.play_switch_sound()
func play_footstep(): func play_footstep():
var sound = footstep_sounds[ground_type][randi() % len(footstep_sounds[ground_type])] if ground_type in footstep_sounds:
Globals.play_sound(sound, "Sounds", self) var sound = footstep_sounds[ground_type][randi() % len(footstep_sounds[ground_type])]
Globals.play_sound(sound, Globals.Bus.Sounds, self)
func get_current_weapon_slot(): func get_current_weapon_slot():
return get_weapon_slot(current_weapon) return get_weapon_slot(current_weapon)
@ -133,11 +143,13 @@ func switch_next_weapon_slot():
func enter_water(force: float): func enter_water(force: float):
is_in_water = true is_in_water = true
ground_type = GroundType.WATER
if abs(force) >= 50: if abs(force) >= 50:
Globals.play_sound(water_splash_sound, Globals.Bus.Sounds, self) Globals.play_sound(water_splash_sound, Globals.Bus.Sounds, self)
func exit_water(force: float): func exit_water(force: float):
is_in_water = false is_in_water = false
ground_type = GroundType.GRASS
func _ready(): func _ready():
if animation_tree_path: if animation_tree_path:
@ -151,6 +163,8 @@ func _physics_process(delta):
if not animation_tree: if not animation_tree:
return return
if not Globals.process_3d_inputs:
return
# Blend nicely between animations # Blend nicely between animations
var movement_vector = Vector2.ZERO var movement_vector = Vector2.ZERO
if Input.is_action_pressed("move_forward"): if Input.is_action_pressed("move_forward"):
@ -168,8 +182,9 @@ func _physics_process(delta):
func _process(delta): func _process(delta):
if Engine.editor_hint: if Engine.editor_hint:
return return
move_axis.x = Input.get_action_strength("move_forward") - Input.get_action_strength("move_backward") if Globals.process_3d_inputs:
move_axis.y = Input.get_action_strength("move_right") - Input.get_action_strength("move_left") move_axis.x = Input.get_action_strength("move_forward") - Input.get_action_strength("move_backward")
move_axis.y = Input.get_action_strength("move_right") - Input.get_action_strength("move_left")
func fire_pressed(): func fire_pressed():
current_weapon.activate(Globals.target_position["position"]) current_weapon.activate(Globals.target_position["position"])
@ -194,11 +209,12 @@ func walk(delta: float) -> void:
# Jump # Jump
var _snap: Vector3 var _snap: Vector3
if is_on_floor(): if can_jump and is_on_floor():
_snap = Vector3.DOWN _snap = Vector3.DOWN
if Input.is_action_just_pressed("move_jump"): if Input.is_action_just_pressed("move_jump"):
_snap = Vector3.ZERO _snap = Vector3.ZERO
velocity.y = jump_height velocity.y = jump_height
emit_signal("jumped")
# Apply Gravity # Apply Gravity
velocity.y -= gravity * delta velocity.y -= gravity * delta
@ -232,13 +248,12 @@ func walk(delta: float) -> void:
velocity.z = _temp_vel.z velocity.z = _temp_vel.z
# clamping (to stop on slopes) # clamping (to stop on slopes)
if direction.dot(velocity) == 0: if direction.dot(velocity) == 0:
var _vel_clamp := 0.0001 var _vel_clamp := 1
if velocity.x < _vel_clamp and velocity.x > -_vel_clamp: if velocity.x < _vel_clamp and velocity.x > -_vel_clamp:
velocity.x = 0 velocity.x = 0
if velocity.z < _vel_clamp and velocity.z > -_vel_clamp: if velocity.z < _vel_clamp and velocity.z > -_vel_clamp:
velocity.z = 0 velocity.z = 0
# Move # Move
#print_debug(velocity) velocity = move_and_slide(velocity, FLOOR_NORMAL, true, 4, deg2rad(floor_max_angle))
velocity.y = move_and_slide_with_snap(velocity, _snap, FLOOR_NORMAL, true, 4, deg2rad(floor_max_angle)).y # velocity.y = move_and_slide_with_snap(velocity, _snap, FLOOR_NORMAL, true, 4, deg2rad(floor_max_angle)).y
#print_debug("is on floor: %s" % is_on_floor())

View File

@ -58,6 +58,8 @@ func activate(_to: Vector3):
func deactivate(to: Vector3): func deactivate(to: Vector3):
if not has_ammo():
return
if activation_type == WeaponType.OneShot: if activation_type == WeaponType.OneShot:
return return
elif activation_type == WeaponType.Activated: elif activation_type == WeaponType.Activated:

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@ class_name TPSController
export var character_scene: PackedScene export var character_scene: PackedScene
var character: Character var character: Character
var is_in_menu: bool = false var is_in_menu: bool = false
onready var cam = $Head/Camera onready var cam = $Head/SpringArm/Camera
onready var default_camera_trans = cam.transform onready var default_camera_trans = cam.transform
export var FOV = 80.0 export var FOV = 80.0
export var HUD_scene: PackedScene export var HUD_scene: PackedScene
@ -22,7 +22,6 @@ func _ready():
add_child(HUD) add_child(HUD)
character = character_scene.instance() character = character_scene.instance()
add_child(character) add_child(character)
func get_target() -> Dictionary: func get_target() -> Dictionary:
var weapon = character.current_weapon var weapon = character.current_weapon
@ -59,10 +58,7 @@ func _physics_process(delta):
else: else:
cam.set_fov(lerp(cam.fov, FOV, delta * 8)) cam.set_fov(lerp(cam.fov, FOV, delta * 8))
head.global_transform.origin = character.global_transform.origin head.global_transform.origin = character.global_transform.origin
# cam.rotation = character.rotation
#head.transform.basis.y = character.global_transform.basis.y
#head.transform.basis.z = character.global_transform.basis.z
# TPSController.head.global_transform = global_transform
func camera_rotation() -> void: func camera_rotation() -> void:
if mouse_axis.length() > 0: if mouse_axis.length() > 0:
@ -74,12 +70,9 @@ func camera_rotation() -> void:
mouse_axis = Vector2.ZERO mouse_axis = Vector2.ZERO
character.rotate_y(deg2rad(horizontal)) character.rotate_y(deg2rad(horizontal))
head.rotation_degrees = head.rotation_degrees + Vector3(vertical, horizontal, 0)
#head.rotate_y(deg2rad(horizontal))
#head.rotate_x(deg2rad(vertical))
# Clamp mouse rotation
var temp_rot: Vector3 = head.rotation_degrees var temp_rot: Vector3 = head.rotation_degrees
temp_rot += Vector3(vertical, horizontal, 0)
temp_rot.x = clamp(temp_rot.x, -75, 75) temp_rot.x = clamp(temp_rot.x, -75, 75)
head.rotation_degrees = temp_rot head.rotation_degrees = temp_rot
@ -96,7 +89,7 @@ func _input(event: InputEvent) -> void:
camera_front_transform = default_camera_trans.translated(Vector3(5, 0, -5)) camera_front_transform = default_camera_trans.translated(Vector3(5, 0, -5))
camera_front_transform = camera_front_transform.rotated(Vector3.UP, deg2rad(-180)) camera_front_transform = camera_front_transform.rotated(Vector3.UP, deg2rad(-180))
cam.transform = camera_front_transform cam.transform = camera_front_transform
else: if Input.is_action_just_released("camera_front"):
cam.transform = default_camera_trans cam.transform = default_camera_trans
if Input.is_action_just_pressed("inp_fire"): if Input.is_action_just_pressed("inp_fire"):
@ -115,6 +108,10 @@ func _input(event: InputEvent) -> void:
ingame_menu.connect("tree_exited", self, "_ingamemenu_closed") ingame_menu.connect("tree_exited", self, "_ingamemenu_closed")
Globals.process_3d_inputs = false Globals.process_3d_inputs = false
func _ingamemenu_closed():
Globals.process_3d_inputs = true
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
func _process(_delta: float) -> void: func _process(_delta: float) -> void:
if Engine.editor_hint: if Engine.editor_hint:
return return
@ -130,4 +127,8 @@ func update_hud() -> void:
var weapon_icon: Control = weapon.ui_icon var weapon_icon: Control = weapon.ui_icon
if not weapon_icon.get_parent() == hud_weapon_slot: if not weapon_icon.get_parent() == hud_weapon_slot:
hud_weapon_slot.add_child(weapon_icon) hud_weapon_slot.add_child(weapon_icon)
if character.current_weapon == weapon:
hud_weapon_slot.get_node("selected").visible = true
else:
hud_weapon_slot.get_node("selected").visible = false

View File

@ -9,12 +9,16 @@ script = ExtResource( 1 )
HUD_scene = ExtResource( 2 ) HUD_scene = ExtResource( 2 )
[node name="Head" type="Spatial" parent="."] [node name="Head" type="Spatial" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
[node name="Camera" type="Camera" parent="Head"] [node name="SpringArm" type="SpringArm" parent="Head"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 10, 10 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10, 5 )
spring_length = 10.0
margin = 1.0
[node name="Camera" type="Camera" parent="Head/SpringArm"]
environment = ExtResource( 3 ) environment = ExtResource( 3 )
current = true current = true
near = 0.01
far = 8192.0 far = 8192.0
[node name="DebugText" type="Label" parent="."] [node name="DebugText" type="Label" parent="."]

View File

@ -140,6 +140,12 @@ move_sprint={
] ]
} }
[layer_names]
3d_physics/layer_1="World"
3d_physics/layer_2="Characters"
3d_physics/layer_3="Weapons"
[network] [network]
limits/debugger_stdout/max_chars_per_second=10000 limits/debugger_stdout/max_chars_per_second=10000

View File

@ -1,10 +1,9 @@
extends Spatial extends Spatial
tool
onready var logo = $Logo onready var logo = $Logo
onready var camera = $Camera onready var camera = $Camera
var playground = preload("res://scenes/playground.tscn")
func _ready(): func _ready():
pass pass

View File

@ -124,7 +124,7 @@ streak_strength = 0.5
lens_dirt = ExtResource( 13 ) lens_dirt = ExtResource( 13 )
[node name="Logo" type="MeshInstance" parent="."] [node name="Logo" type="MeshInstance" parent="."]
transform = Transform( -5, -4.37114e-07, -1.91069e-14, 0, -2.18557e-07, 5, -4.37114e-07, 5, 2.18557e-07, 233, 1117, 329 ) transform = Transform( -4.37114e-08, 0.707107, 0.707107, 0, -0.707107, 0.707107, 1, 3.09086e-08, 3.09086e-08, -1043.22, 756.934, 66 )
mesh = ExtResource( 15 ) mesh = ExtResource( 15 )
material/0 = null material/0 = null
material/1 = null material/1 = null

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=109 format=2] [gd_scene load_steps=110 format=2]
[ext_resource path="res://assets/M_3WL1_env.tres" type="Environment" id=1] [ext_resource path="res://assets/M_3WL1_env.tres" type="Environment" id=1]
[ext_resource path="res://assets/all_gbs/Giants_logo_3D.gbs.obj" type="ArrayMesh" id=2] [ext_resource path="res://assets/all_gbs/Giants_logo_3D.gbs.obj" type="ArrayMesh" id=2]
@ -13,6 +13,7 @@
[ext_resource path="res://assets/all_gbs/textures/M_3w_L2_wall.tga" type="Texture" id=11] [ext_resource path="res://assets/all_gbs/textures/M_3w_L2_wall.tga" type="Texture" id=11]
[ext_resource path="res://assets/audio/Stream/Ambient/AM_DSAN7.wav" type="AudioStream" id=12] [ext_resource path="res://assets/audio/Stream/Ambient/AM_DSAN7.wav" type="AudioStream" id=12]
[ext_resource path="res://characters/vimp.tscn" type="PackedScene" id=13] [ext_resource path="res://characters/vimp.tscn" type="PackedScene" id=13]
[ext_resource path="res://assets/audio/Sounds/AM_MS1Q.xx_sm_evil.gzp.wav" type="AudioStream" id=14]
[ext_resource path="res://scenes/realistic_water.tscn" type="PackedScene" id=16] [ext_resource path="res://scenes/realistic_water.tscn" type="PackedScene" id=16]
[sub_resource type="ConvexPolygonShape" id=1] [sub_resource type="ConvexPolygonShape" id=1]
@ -313,6 +314,7 @@ environment = ExtResource( 1 )
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 8 ) stream = ExtResource( 8 )
autoplay = true
bus = "Music" bus = "Music"
[node name="DirectionalLight" type="DirectionalLight" parent="."] [node name="DirectionalLight" type="DirectionalLight" parent="."]
@ -638,3 +640,7 @@ character_scene = ExtResource( 4 )
[node name="Vimp" parent="." instance=ExtResource( 13 )] [node name="Vimp" parent="." instance=ExtResource( 13 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1264, 26, 505 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1264, 26, 505 )
[node name="AudioStreamPlayer3D2" type="AudioStreamPlayer3D" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1475, 88, 629 )
stream = ExtResource( 14 )

View File

@ -23,16 +23,19 @@ func create_empty_collision_dictionnary(to: Vector3) -> Dictionary:
func play_sound(sound: AudioStreamSample, bus: String, parent: Spatial = null): func play_sound(sound: AudioStreamSample, bus: String, parent: Spatial = null):
if parent: if parent:
var stream = AudioStreamPlayer3D.new() var stream = AudioStreamPlayer3D.new()
stream.transform = parent.transform stream.global_transform = parent.global_transform
parent.add_child(stream)
stream.unit_size = 100
stream.bus = bus
stream.stream = sound stream.stream = sound
stream.play() stream.autoplay = true
stream.unit_size = 1000
stream.bus = bus
stream.unit_db = 5
parent.add_child(stream)
stream.connect("finished", stream, "queue_free") stream.connect("finished", stream, "queue_free")
else: else:
var stream = AudioStreamPlayer.new() var stream = AudioStreamPlayer.new()
get_tree().root.add_child(stream)
stream.bus = bus stream.bus = bus
stream.stream = sound stream.stream = sound
stream.volume_db = linear2db(1)
stream.play() stream.play()
stream.connect("finished", stream, "queue_free") stream.connect("finished", stream, "queue_free")

View File

@ -3,13 +3,18 @@ onready var options_menu = preload("res://ui/menus/options_menu.tscn").instance(
func _ready(): func _ready():
options_menu.called_ui = self options_menu.called_ui = self
options_menu.connect("tree_exited", self, "options_menu_closed")
func _on_Resume_pressed(): func _on_Resume_pressed():
get_parent().remove_child(self) get_parent().remove_child(self)
func _on_Options_pressed(): func _on_Options_pressed():
get_parent().add_child(options_menu) get_parent().add_child(options_menu)
get_parent().remove_child(self) self.visible = false
# get_parent().remove_child(self)
func options_menu_closed():
self.visible = true
func _on_MainMenu_pressed(): func _on_MainMenu_pressed():
get_tree().change_scene("res://scenes/intro_island/MainMenu.tscn") get_tree().change_scene("res://scenes/intro_island/MainMenu.tscn")

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=9 format=2] [gd_scene load_steps=10 format=2]
[ext_resource path="res://assets/all_gbs/textures/st_mec_energy.tga" type="Texture" id=1] [ext_resource path="res://assets/all_gbs/textures/st_mec_energy.tga" type="Texture" id=1]
[ext_resource path="res://assets/all_gbs/textures/st_delphi.tga" type="Texture" id=2] [ext_resource path="res://assets/all_gbs/textures/st_delphi.tga" type="Texture" id=2]
@ -8,6 +8,7 @@
[ext_resource path="res://assets/all_gbs/textures/st_rp_slot3.tga" type="Texture" id=6] [ext_resource path="res://assets/all_gbs/textures/st_rp_slot3.tga" type="Texture" id=6]
[ext_resource path="res://ui/rp_weapon_icon.tscn" type="PackedScene" id=7] [ext_resource path="res://ui/rp_weapon_icon.tscn" type="PackedScene" id=7]
[ext_resource path="res://assets/all_gbs/textures/st_rp_slot3k.tga" type="Texture" id=8] [ext_resource path="res://assets/all_gbs/textures/st_rp_slot3k.tga" type="Texture" id=8]
[ext_resource path="res://assets/all_gbs/textures/st_rp_slot2k.tga" type="Texture" id=9]
[node name="UI" type="Control"] [node name="UI" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
@ -89,18 +90,23 @@ __meta__ = {
} }
[node name="equipment" type="Control" parent="."] [node name="equipment" type="Control" parent="."]
anchor_right = 1.0 anchor_left = 0.546
anchor_top = 1.0
anchor_right = 0.546
anchor_bottom = 1.0 anchor_bottom = 1.0
margin_left = 267.0 margin_left = -559.104
margin_top = 462.0 margin_top = -600.0
margin_right = -337.0 margin_right = -559.104
margin_bottom = -41.0 margin_bottom = -600.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="weapons" type="TextureRect" parent="equipment"] [node name="weapons" type="TextureRect" parent="equipment"]
anchor_right = 1.219 margin_left = 257.257
anchor_bottom = 1.423 margin_top = 456.661
margin_right = 0.0199585 margin_right = 769.257
margin_bottom = -0.0310059 margin_bottom = 584.661
texture = ExtResource( 6 ) texture = ExtResource( 6 )
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
@ -115,6 +121,19 @@ __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="selected" type="TextureRect" parent="equipment/weapons/Weapon0"]
visible = false
self_modulate = Color( 1, 1, 1, 0.196078 )
margin_left = -7.0
margin_top = 9.0
margin_right = 113.0
margin_bottom = 130.0
texture = ExtResource( 9 )
expand = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="rp_weapon_icon" parent="equipment/weapons/Weapon0" instance=ExtResource( 7 )] [node name="rp_weapon_icon" parent="equipment/weapons/Weapon0" instance=ExtResource( 7 )]
visible = false visible = false
@ -127,6 +146,19 @@ __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="selected" type="TextureRect" parent="equipment/weapons/Weapon1"]
visible = false
self_modulate = Color( 1, 1, 1, 0.196078 )
margin_left = -7.0
margin_top = 10.0
margin_right = 113.0
margin_bottom = 131.0
texture = ExtResource( 9 )
expand = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="rp_weapon_icon" parent="equipment/weapons/Weapon1" instance=ExtResource( 7 )] [node name="rp_weapon_icon" parent="equipment/weapons/Weapon1" instance=ExtResource( 7 )]
visible = false visible = false
@ -136,6 +168,19 @@ margin_top = 2.0
margin_right = 297.0 margin_right = 297.0
margin_bottom = 98.0 margin_bottom = 98.0
[node name="selected" type="TextureRect" parent="equipment/weapons/Weapon2"]
visible = false
self_modulate = Color( 1, 1, 1, 0.196078 )
margin_left = -7.0
margin_top = 9.0
margin_right = 113.0
margin_bottom = 130.0
texture = ExtResource( 9 )
expand = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="rp_weapon_icon" parent="equipment/weapons/Weapon2" instance=ExtResource( 7 )] [node name="rp_weapon_icon" parent="equipment/weapons/Weapon2" instance=ExtResource( 7 )]
visible = false visible = false
@ -145,6 +190,19 @@ margin_top = 2.0
margin_right = 398.0 margin_right = 398.0
margin_bottom = 98.0 margin_bottom = 98.0
[node name="selected" type="TextureRect" parent="equipment/weapons/Weapon3"]
visible = false
self_modulate = Color( 1, 1, 1, 0.196078 )
margin_left = -8.0
margin_top = 9.0
margin_right = 112.0
margin_bottom = 130.0
texture = ExtResource( 9 )
expand = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="rp_weapon_icon" parent="equipment/weapons/Weapon3" instance=ExtResource( 7 )] [node name="rp_weapon_icon" parent="equipment/weapons/Weapon3" instance=ExtResource( 7 )]
visible = false visible = false
@ -153,16 +211,29 @@ margin_left = 401.0
margin_right = 497.0 margin_right = 497.0
margin_bottom = 96.0 margin_bottom = 96.0
[node name="selected" type="TextureRect" parent="equipment/weapons/Weapon4"]
visible = false
self_modulate = Color( 1, 1, 1, 0.196078 )
margin_left = -7.0
margin_top = 11.0
margin_right = 113.0
margin_bottom = 132.0
texture = ExtResource( 9 )
expand = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="rp_weapon_icon" parent="equipment/weapons/Weapon4" instance=ExtResource( 7 )] [node name="rp_weapon_icon" parent="equipment/weapons/Weapon4" instance=ExtResource( 7 )]
visible = false visible = false
[node name="specials" type="TextureRect" parent="equipment"] [node name="specials" type="TextureRect" parent="equipment"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
margin_left = 256.191 margin_left = 513.0
margin_top = -128.454 margin_top = 329.0
margin_right = 472.191 margin_right = -255.0
margin_bottom = -40.454 margin_bottom = -131.0
texture = ExtResource( 8 ) texture = ExtResource( 8 )
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false