Exemplo n.º 1
0
        public override void Update(GameSettings settings)
        {
            PointFloat vel  = GetVelocity();
            float      rotV = GetRotationVelocity();

            rotV = rotV - (rotV / 50);
            if (ControlKeys.IsKeyDown("s"))
            {
                vel = MoveBackward(vel);
            }
            if (ControlKeys.IsKeyDown("w"))
            {
                vel = MoveForward(vel);
                //Console.WriteLine(GetPosition().x + " " + GetPosition().y);
            }

            if (ControlKeys.IsKeyDown("d"))
            {
                rotV = rotV + (0.05f - rotV);
            }
            if (ControlKeys.IsKeyDown("a"))
            {
                rotV = rotV + (-0.05f - rotV);
            }
            if (ControlKeys.IsKeyDown("e"))
            {
                gun.SetPos(Helpers.PhysicsAndPositions.OffsetPosition(GetPosition(), 2.0f, GetRotation() + (float)Math.PI * 0.5f));
                gun.SetRot(GetRotation());
                gun.SetSpread(Helpers.PhysicsAndPositions.PI * 2);
                gun.SetLifeTime(100, 200);
                gun.Blow(1f, 100, false);
            }
            SetVelocity(vel);
            SetRotationVelocity(rotV);
            base.Update(settings);
            engineFirePar.SetPos(Helpers.PhysicsAndPositions.OffsetPosition(GetPosition(), 1.0f, GetRotation() + (float)Math.PI * 1.5f));
            engineFirePar.SetRot(GetRotation() + 3.14f);
            CamController.SetPos(GetPosition());
        }