Пример #1
0
 public FlyingWheelProjectile(int x, int y, int xVel, int yVel)
 {
     Texture = Main.DefaultTexture;
     CollRectangle = new Rectangle(x, y, 16, 16);
     Velocity = new Vector2(xVel, yVel);
     Light = new DynamicPointLight(this, 1, true, Color.MediumPurple, 1);
     GameWorld.Instance.LightEngine.AddDynamicLight(Light);
 }
Пример #2
0
        public Gem(int centerX, int centerY, byte id)
        {
            _gemId = id;
            Texture = GameWorld.SpriteSheet;
            CollRectangle = new Rectangle(centerX, centerY, 16, 16);
            SourceRectangle = GetSourceRectangle();
            Velocity = new Vector2(GameWorld.RandGen.Next(-100, 100) / 10f, -GameWorld.RandGen.Next(100, 180) / 10f);
            Light = new Lights.DynamicPointLight(this, .5f, false, GetGemColor(), .8f);
            GameWorld.Instance.LightEngine.AddDynamicLight(Light);

            PickUpSound = new Misc.SoundFx("Sounds/Items/gold" + GameWorld.RandGen.Next(0, 5));

            OnPlayerPickUp += Gem_OnPlayerPickUp;
            CurrentCollisionType = CollisionType.Bouncy;
        }
Пример #3
0
        public TrailParticle(Entity source, Color color)
        {
            Texture = GameWorld.ParticleSpriteSheet;
            CollRectangle = new Rectangle(source.GetCollRectangle().Center.X, source.GetCollRectangle().Center.Y, 8, 8);
            SourceRectangle = new Rectangle(8, 0, 8, 8);
            int buffer = 1;
            Velocity.X = GameWorld.RandGen.Next((int)-source.GetVelocity().X - buffer, (int)-source.GetVelocity().X + buffer + 1) * (float)GameWorld.RandGen.NextDouble();
            Velocity.Y = GameWorld.RandGen.Next((int)-source.GetVelocity().Y - buffer, (int)-source.GetVelocity().Y + buffer + 1);
            Position = new Vector2(CollRectangle.X, CollRectangle.Y);
            Opacity = .5f;

            light = new Lights.DynamicPointLight(this, .5f, false, color, 1);
            GameWorld.Instance.LightEngine.AddDynamicLight(light);
        }
Пример #4
0
        public SparkParticle(Entity source, Color color)
        {
            SourceRectangle = new Rectangle(272, 96, 8, 8);
            Texture = GameWorld.SpriteSheet;
            CollRectangle = new Rectangle(source.GetCollRectangle().X  - 4, source.GetCollRectangle().Y + 4, 8, 8);
            Velocity.X = GameWorld.RandGen.Next(-6, 7);
            Position = new Vector2(CollRectangle.X, CollRectangle.Y);
            Opacity = .7f;

            light = new DynamicPointLight(this, .05f, false, color, .5f);
            GameWorld.Instance.LightEngine.AddDynamicLight(light);
        }
Пример #5
0
        public EntityFlameParticle(Entity source, Color color)
        {
            SourceRectangle = new Rectangle(32 * 8, 12 * 8, 8, 8);
            Texture = GameWorld.SpriteSheet;
            int randX = (int)(GameWorld.RandGen.Next(0, source.GetCollRectangle().Width) * GameWorld.RandGen.NextDouble());
            int randY = (int)(GameWorld.RandGen.Next(0, source.GetCollRectangle().Height) * GameWorld.RandGen.NextDouble());
            CollRectangle = new Rectangle(source.GetCollRectangle().X + randX - 4, source.GetCollRectangle().Y + randY - 4, 8, 8);
            Position = new Vector2(CollRectangle.X, CollRectangle.Y);
            Opacity = .5f;

            Velocity.X = (float)(GameWorld.RandGen.Next(-1, 2) * GameWorld.RandGen.NextDouble());
            Velocity.Y = -3f;

            light = new DynamicPointLight(this, .5f, false, color, .5f);
            GameWorld.Instance.LightEngine.AddDynamicLight(light);
        }
Пример #6
0
        public MachineGunParticle(Entity source, int xCoor)
        {
            SourceRectangle = new Rectangle(264, 96, 8, 8);
            Texture = GameWorld.SpriteSheet;
            CollRectangle = new Rectangle(source.GetCollRectangle().X + xCoor - 4, source.GetCollRectangle().Y + 4, 8, 8);
            Position = new Vector2(CollRectangle.X, CollRectangle.Y);
            Opacity = 1f;
            Velocity.Y = -8f;
            _hitSound = new SoundFx("Sounds/Machine Gun/bulletHit",this);

            light = new DynamicPointLight(this, .05f, false, Color.White, .5f);
            GameWorld.Instance.LightEngine.AddDynamicLight(light);
        }
Пример #7
0
        public ExplosionParticle(int x, int y, Color color, float intensity)
        {
            CollRectangle = new Rectangle(x - 4, y - 4, 8, 8);
            Position = new Vector2(CollRectangle.X, CollRectangle.Y);
            Opacity = 1;
            SourceRectangle = new Rectangle(32 * 8, 12 * 8, 8, 8);
            Texture = GameWorld.SpriteSheet;

            light = new DynamicPointLight(this, intensity, false, color, intensity);
            GameWorld.Instance.LightEngine.AddDynamicLight(light);
        }