ZombieFinish
This commit is contained in:
parent
b62fcb760f
commit
0286c53706
5 changed files with 43 additions and 6 deletions
|
@ -122,6 +122,18 @@
|
|||
/processorParam:Quality=Best
|
||||
/build:sounds/Zombi stoit.wav
|
||||
|
||||
#begin sounds/zombie sound 2.wav
|
||||
/importer:WavImporter
|
||||
/processor:SoundEffectProcessor
|
||||
/processorParam:Quality=Best
|
||||
/build:sounds/zombie sound 2.wav
|
||||
|
||||
#begin sounds/zombie sound.wav
|
||||
/importer:WavImporter
|
||||
/processor:SoundEffectProcessor
|
||||
/processorParam:Quality=Best
|
||||
/build:sounds/zombie sound.wav
|
||||
|
||||
#begin Textures/Animations/player_down_idle.animation
|
||||
/copy:Textures/Animations/player_down_idle.animation
|
||||
|
||||
|
|
BIN
ZoFo/Content/sounds/zombie sound 2.wav
Normal file
BIN
ZoFo/Content/sounds/zombie sound 2.wav
Normal file
Binary file not shown.
BIN
ZoFo/Content/sounds/zombie sound.wav
Normal file
BIN
ZoFo/Content/sounds/zombie sound.wav
Normal file
Binary file not shown.
|
@ -28,13 +28,14 @@ namespace ZoFo.GameCore.GameManagers
|
|||
public void SetMainVolume(float volume)
|
||||
{
|
||||
settingsContainer.MainVolume = volume;
|
||||
AppManager.Instance.SoundManager.Update();
|
||||
// AppManager.Instance.SoundManager.Update();
|
||||
SaveSettings();
|
||||
}
|
||||
public void SetMusicVolume(float volume)
|
||||
{
|
||||
settingsContainer.MusicVolume = volume;
|
||||
//AppManager.Instance.SoundManager.Update();
|
||||
|
||||
SaveSettings();
|
||||
|
||||
}
|
||||
|
@ -70,6 +71,7 @@ namespace ZoFo.GameCore.GameManagers
|
|||
}
|
||||
public void SaveSettings()
|
||||
{
|
||||
AppManager.Instance.SoundManager.Update();
|
||||
using (StreamWriter streamWriter = new StreamWriter("GameSettings.txt"))
|
||||
{
|
||||
string _str = JsonConvert.SerializeObject(settingsContainer);
|
||||
|
|
|
@ -36,15 +36,36 @@ namespace ZoFo.GameCore.GameObjects
|
|||
|
||||
public override void Update()
|
||||
{
|
||||
Vector2 duration = Vector2.Normalize(
|
||||
AppManager.Instance.server.players[0].position - position
|
||||
float m = 10000000;
|
||||
int j = -1;
|
||||
for (int i = 0; i < AppManager.Instance.server.players.Count; i++)
|
||||
{
|
||||
var player = AppManager.Instance.server.players[i];
|
||||
if (m > (player.position.X - position.X) * (player.position.X - position.X) + (player.position.Y - position.Y) * (player.position.Y - position.Y))
|
||||
{
|
||||
m = (player.position.X - position.X) * (player.position.X - position.X) + (player.position.Y - position.Y) * (player.position.Y - position.Y);
|
||||
j = i;
|
||||
}
|
||||
}
|
||||
Vector2 duration = Vector2.Zero;
|
||||
if (m<= 130000)
|
||||
{
|
||||
duration = Vector2.Normalize(
|
||||
AppManager.Instance.server.players[j].position - position
|
||||
);
|
||||
|
||||
|
||||
if (new Random().Next(0, 1000) == 0)
|
||||
{
|
||||
AppManager.Instance.SoundManager.StartSound("zombie sound", position, AppManager.Instance.server.players[0].position, pitch: new Random().Next(-1, 2) * (float)new Random().NextDouble());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!isAttacking) { velocity += new Vector2(duration.X * speed, duration.Y * speed); }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
public void OnPlayerClose(GameObject sender)
|
||||
{
|
||||
|
@ -52,6 +73,8 @@ namespace ZoFo.GameCore.GameObjects
|
|||
|
||||
if(!isAttacking)
|
||||
{
|
||||
|
||||
AppManager.Instance.SoundManager.StartSound("Zombi napal", position, AppManager.Instance.server.players[0].position,pitch:new Random().Next(-1,2)*(float)new Random().NextDouble());
|
||||
StartAnimation("zombie_attack");
|
||||
isAttacking = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue