Initial main menu impl

This commit is contained in:
2021-04-23 15:07:50 +02:00
parent 05657b14dd
commit 44f0f9e399
10 changed files with 91 additions and 38 deletions
+2 -2
View File
@@ -50,14 +50,14 @@ namespace EvilSatellites.Objects
{
Move(new Vector3(0, 0, -0.05f));
Sound.Position = new System.Numerics.Vector3(Position.X+Dimensions.X/2, Position.Y+Dimensions.Y/2, Position.Z+Dimensions.Z/2);
if (rnd.Next(512) == 250)
if (rnd.Next(1024) == 512)
{
var scr = (GameScreen)Screen;
var player = scr.GetPlayer();
var orient = Matrix.Invert(Matrix.CreateTranslation(Position) * Matrix.CreateLookAt(Position, scr.GetPlayer().Position, Rotation.Up));
var dir = Position - player.Position;
dir.Normalize();
Screen.Manager.Sound.PlayOneshot(@"sfx/weapons/LaserCannon/fire/" + (rnd.Next(2) + 1).ToString() + ".wav", new System.Numerics.Vector3(Position.X + Dimensions.X / 2, Position.Y + Dimensions.Y / 2, Position.Z / Dimensions.Z / 2), Screen.Manager.EnvironmentEffect);
var proj = new Projectile(Screen, Position, orient, this);
// proj.Direction = dir;
scr.AddObject(proj);