Exemplo n.º 1
0
        public Ship(
            Vector2 _position,
            World _world
        )
            : base(_world)
        {
            Name = ShipNameGenerator.GenerateName();
            Texture = Res.Textures["ship"];
            Position = _position;
            Size = new Vector2(32, 32);
            TargetPosition = null;
            Direction = Math.PI;
            Speed = 0;
            MaxSpeed = 3;
            Acceleration = 0.002f;

            Components = new List<ShipComponent>();
            Shield = new Shield(Game.Random.Next(50, 100), 100);
            health = maxHealth = 100;

            Inventory = new List<Item>();

            Tags = new List<string>();
            Tags.Add("ship");

            Visible = true;
            Depth = 1;

            EngineTrail =
                new Particle2()
                .SetPosition(Vector2.Zero, 4)
                //velocity is the oddball, going px/s instead of px/t
                .SetVelocity(Vector2.Zero, 50)
                .SetFriction(0.05f, 0.03f, 0.01f)
                .SetColour(
                    new Color(1f,0.4f,0f,1f),
                    new Color(0f,0.4f,0f,1f),
                    new Color(0f,0f,0f,0f))
                .SetScale(1.5f, 0.35f, 0f)
                .SetRotation(0, Math.PI*2f, 0) //add delta variation
                .SetTexture(Res.Textures["1x1"])
                .SetLifeTime(600, 350);
        }
Exemplo n.º 2
0
 public static void AddParticle(Particle2 _p)
 {
     if (Particles.Count == 0)
         last = DateTime.Now;
     Particles.Add(_p);
 }