public Butterfly(GameplayScreen screen)
            : base(screen)
        {
            Radius = 4;

            Vector3 initPos = new Vector3();
            initPos.X = MathHelper.Lerp(screen.world.Limits.Min.X, screen.world.Limits.Max.X, screen.random.NextFloat());
            initPos.Y = MathHelper.Lerp(screen.world.Limits.Min.Y, screen.world.Limits.Max.Y, screen.random.NextFloat());
            initPos.Z = 0;

            Position = initPos;

            MaxForce = 5 * 1.65f;
            MaxSpeed = MathHelper.Lerp(8, 12, screen.random.NextFloat()) * 1.65f;

            MaxSpeed = 75;
            MaxForce = 3 * MaxSpeed;

            Speed = MathHelper.Lerp(MaxSpeed / 2, MaxSpeed, screen.random.NextFloat());

            float angle = (float)(screen.random.NextFloat() * MathHelper.TwoPi);
            Velocity = new Vector3((float)Math.Cos(angle), (float)Math.Sin(angle), 0) * Speed;

            alpha = new Controller(screen.random.NextFloat(),
                MathHelper.Lerp(0.4f, 0.8f, screen.random.NextFloat()), 0, 1, Controller.Mode.OSCILLATE);
            radiusOffset = new Controller(
                screen.random.NextFloat() * 4 - 2, 50, -2, 2, Controller.Mode.OSCILLATE);

            Controller animSpeed = new Controller(2, 1, 3, 7, Controller.Mode.OSCILLATE);
            anim = new AnimController(animSpeed);
        }
Example #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 public Boid(GameplayScreen screen)
     : base(screen)
 {
     Mass = 1;
     Radius = 5;
     Position = new Vector3(0, 0, 0);
     Forward = new Vector3(0, 1, 0);
     Right = new Vector3(1, 0, 0);
     Up = new Vector3(0, 0, 1);
     Speed = 0;
     MaxSpeed = 1.0f;
     MaxForce = 0.1f;
 }
Example #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="screen">gameplay screen</param>
        public Player(GameplayScreen screen)
            : base(screen)
        {
            Radius = 8;
            Position = new Vector3(0,0,0);
            MaxSpeed = 75;
            MaxForce = 3 * MaxSpeed;
            Speed = 0;

            Controller animSpeed = new Controller(2, 1, 2, 3, Controller.Mode.OSCILLATE);
            anim = new AnimController(animSpeed);

            ghostEffect = new GhostEffect(screen, this);
            sonar = new Sonar(screen);
        }
 public DrawPrims(GameplayScreen screen)
     : base(screen)
 {
     basicPrim = null;
 }
Example #5
0
 public Sonar(GameplayScreen screen)
     : base(screen)
 {
     pings = new List<Ping>();
 }
Example #6
0
 public BoidManager(GameplayScreen screen)
     : base(screen)
 {
 }
 public ParticleSystem(GameplayScreen screen)
     : base(screen)
 {
 }
 public GhostEffect(GameplayScreen screen, Boid boid)
     : base(screen)
 {
     this.boid = boid;
 }
Example #9
0
 public World(GameplayScreen screen)
     : base(screen)
 {
 }
 public Highscores(GameplayScreen screen)
     : base(screen)
 {
 }