clean up + hitsounds

This commit is contained in:
2022-04-18 13:37:00 +03:00
parent 84f8452f83
commit 48d2e3029e
5 changed files with 21 additions and 111 deletions

BIN
Assets/Audio/hitsound.wav Normal file

Binary file not shown.

BIN
Assets/Audio/hitsound2.wav Normal file

Binary file not shown.

View File

@@ -70,13 +70,13 @@
"Transform": {
"Translation": {
"X": 0.0,
"Y": 893.0,
"Y": 411.0,
"Z": 0.0
}
},
"Control": "FlaxEngine.GUI.Label",
"Data": {
"Text": "eFPS: 15 uTime: 176.6672213\nuFPS: 15 uTime: 0.00833330024033785\nrFPS: 15 rTime: 0\npFPS: 30 pTime: 0",
"Text": "eFPS: 60 uTime: 2.1192164\nuFPS: 60 uTime: 0.00833330024033785\nrFPS: 60 rTime: 0\npFPS: 30 pTime: 0",
"TextColor": {
"R": 1.0,
"G": 1.0,
@@ -123,7 +123,7 @@
},
"Offsets": {
"Left": 0.0,
"Right": 224.0,
"Right": 247.999985,
"Top": -97.0,
"Bottom": 64.0
},
@@ -164,8 +164,8 @@
"Name": "ContainerControl 0",
"Transform": {
"Translation": {
"X": 45774.0,
"Y": 89.0,
"X": 44996.0,
"Y": -152.0,
"Z": 0.0
}
},
@@ -444,94 +444,6 @@
{}
]
}
},
{
"ID": "9b9be0a542cc06e3172f4ea660188187",
"TypeName": "FlaxEngine.PointLight",
"ParentID": "194e05f445ece24ec5448d886e1334df",
"Name": "PointLight",
"Transform": {
"Translation": {
"X": 39.102020263671878,
"Y": 0.0,
"Z": -272.16845703125
}
},
"Layer": 1
},
{
"ID": "40f4157e459965f46341349a68a45a97",
"TypeName": "FlaxEngine.StaticModel",
"ParentID": "194e05f445ece24ec5448d886e1334df",
"Name": "Cube",
"Transform": {
"Translation": {
"X": 24.744918823242189,
"Y": -28.835121154785158,
"Z": -250.5230712890625
},
"Scale": {
"X": 1.0,
"Y": 1.0,
"Z": 0.26938098669052126
}
},
"Model": "b43f0f8f4aaba3f3156896a5a22ba493",
"Buffer": {
"Entries": [
{
"Material": "a75d425f40ef7ba5df0fdb8d470e8a78",
"ShadowsMode": 3,
"Visible": true,
"ReceiveDecals": true
}
]
}
},
{
"ID": "7b839a414de795042aad419a3540835b",
"TypeName": "FlaxEngine.PointLight",
"ParentID": "194e05f445ece24ec5448d886e1334df",
"Name": "PointLight 0",
"Transform": {
"Translation": {
"X": -105.39958953857422,
"Y": 97.99998474121094,
"Z": -457.7042541503906
}
}
},
{
"ID": "9d92201b47a6b303783bf9a4e887f07b",
"TypeName": "FlaxEngine.PointLight",
"ParentID": "194e05f445ece24ec5448d886e1334df",
"Name": "PointLight 1",
"Transform": {
"Translation": {
"X": -405.058837890625,
"Y": 162.0,
"Z": -296.0974426269531
}
}
},
{
"ID": "775084d246f37cc28f3b25a4a32337ef",
"TypeName": "FlaxEngine.SpotLight",
"ParentID": "194e05f445ece24ec5448d886e1334df",
"Name": "SpotLight",
"Transform": {
"Translation": {
"X": -445.448974609375,
"Y": 351.6558532714844,
"Z": 336.9117126464844
},
"Orientation": {
"X": 0.0,
"Y": 0.9641308188438416,
"Z": 0.0,
"W": 0.2654274106025696
}
}
}
]
}

View File

@@ -933,13 +933,13 @@ namespace Game
//rigidBody.LinearVelocity = velocity;
const float landingVelocityThreshold = 120f;
//if (currentVelocity.Y - lastVelocity.Y > landingVelocityThreshold)
const float landingHardVelocityThreshold = 500f;
if (currentVelocity.Y - lastVelocity.Y > landingVelocityThreshold)
{
if (Time.GameTime - lastJumped > 0.01)
{
Console.Print("landtime: " + (Time.GameTime - lastJumped) * 1000.0f + "ms, vel: " + currentVelocity.Y);
OnLanded(currentVelocity - lastVelocity);
bool hardLanding = currentVelocity.Y - lastVelocity.Y > landingHardVelocityThreshold;
OnLanded(currentVelocity - lastVelocity, hardLanding);
lastLanded = Time.GameTime;
}
}
@@ -956,29 +956,20 @@ namespace Game
velocity += Vector3.Up * jumpVelocity;
Console.Print("jump");
if (!predicting)
{
// Avoid overlapping with recent landing sound
if (Time.GameTime - lastLanded > 0.3)
AudioManager.PlaySound("jumpland", Actor, 0, rootActor.Position, 1f /*, new Vector2(0.7f, 1.3f)*/);
}
#if false
AudioManager.PlaySound("jumpland", Actor, 0, rootActor.Position, 1f/*, new Vector2(0.7f, 1.3f)*/);
AudioManager.PlaySound("jumpland", Actor, 0, rootActor.Position, 1f/*, new Vector2(0.7f, 1.3f)*/);
AudioManager.PlaySound("jumpland", Actor, 0, rootActor.Position, 1f/*, new Vector2(0.7f, 1.3f)*/);
#endif
return true;
}
private void OnLanded(Vector3 landingVelocity)
private void OnLanded(Vector3 landingVelocity, bool hardLanding)
{
const float landingHardVelocityThreshold = 500f;
bool loud = landingVelocity.Y > landingHardVelocityThreshold;
if (!predicting)
AudioManager.PlaySound("jumpland", Actor, 1, rootActor.Position, loud ? 1.0f : 0.7f/*, new Vector2(0.7f, 1.3f)*/);
AudioManager.PlaySound("jumpland", Actor, 1, rootActor.Position, hardLanding ? 1.0f : 0.6f/*, new Vector2(0.7f, 1.3f)*/);
}
private static void ApplyFriction(ref Vector3 velocity)

View File

@@ -1,7 +1,14 @@
footsteps by mypantsfelldown: https://freesound.org/people/mypantsfelldown/sounds/465299/
first step +10 bass and +7 treble, second step untouched
footsteps: (mypantsfelldown)
Concrete Footsteps https://freesound.org/people/mypantsfelldown/sounds/465299/
(first step +10 bass and +7 treble, second step untouched)
fadeout reverb on both steps
hitsounds: (EminYILDIRIM)
Metal Impact https://freesound.org/people/EminYILDIRIM/sounds/582025/
magic sfx by EminYILDIRIM:
https://freesound.org/people/EminYILDIRIM/sounds/626120/