Beispiel #1
0
        public int GetRamShipDmg(Ship ship)
        {
            var shipToShipDot = Vector2.Dot(RotationMatrix.Right.ToVector2(), ship.RotationMatrix.Right.ToVector2());
            var deg           = Math.Abs(shipToShipDot * 180);

            if (deg < RamInstance.HeavyRamAngle)
            {
                Debugger.CommandLineWrite("Heavy Ram");
                return(RamInstance.HeavyRamDamage);
            }
            else if (deg < RamInstance.MediumRamAngle)
            {
                Debugger.CommandLineWrite("Heavy Ram");
                return(RamInstance.MediumRamDamage);
            }
            else if (deg < RamInstance.GlancingRamAngle)
            {
                Debugger.CommandLineWrite("Heavy Ram");
                return(RamInstance.GlancingRamDamage);
            }
            else
            {
                return(0);
            }
        }
Beispiel #2
0
 private void CustomActivity()
 {
     if (this.X > bulletDestroyPosition)
     {
         Debugger.CommandLineWrite("Bullet was destroyed");
         this.Destroy();
     }
 }
Beispiel #3
0
 private void CustomActivity()
 {
     if (this.SpriteInstance.JustCycled && this.SpriteInstance.CurrentChainName == "Die")
     {
         Debugger.CommandLineWrite("Time to destroy");
         this.Destroy();
     }
 }
Beispiel #4
0
        void CustomActivity(bool firstTimeCalled)
        {
            HandleInput();

            //ApplyGravity();

            HandleCollisons();

            if (CameraUp.WasJustPressed)
            {
                Debugger.CommandLineWrite(String.Format("X: {0}, Y: {1}", PlayerInstance.X, PlayerInstance.Y));
            }
        }
Beispiel #5
0
        private void SpawnEnemies()
        {
            for (int i = 0; i < maxEnemies; i++)
            {
                Debugger.CommandLineWrite("Spawned Enemy");

                var x = FlatRedBallServices.Random.Next((int)RightBorder, (int)RightBorder + 200);
                var y = FlatRedBallServices.Random.Next(-270, 270);

                Factories.EnemyFactory.CreateNew(x, y);
                currentEnemies++;
            }
        }
Beispiel #6
0
        private void HandleInput()
        {
            if (CameraUp.WasJustPressed)
            {
                var x = PlayerInstance.X;
                var y = PlayerInstance.Y;

                Debugger.CommandLineWrite(String.Format("X: {0}, Y: {1}", x, y));
            }

            if (CameraUp.IsDown)
            {
                Debugger.ClearCommandLine();
            }
        }
Beispiel #7
0
        // Set animation states
        public void SetState(string state)
        {
            Debugger.CommandLineWrite(String.Format("Changing state to: {0}", state));
            switch (state)
            {
            case "Flying":
                this.SpriteInstance.CurrentChainName = "Flying";
                break;

            case "Die":
                this.SpriteInstance.CurrentChainName = "Die";
                this.SpriteInstance.TextureScale     = 3;
                this.XVelocity = XVelocity / 1.25f; // slow it down
                this.YVelocity = -50;               // and fall down
                break;
            }
        }