Beispiel #1
0
        public BaseExplosion(Vector2 position, Color explosionColor, float radius)
        {
            this.Position = position;
            this.radius = radius;
            this.AdditiveWhite = 0.2f;
            this.FriendlyExplosion = false;

            Particle particlePrototype = new Particle();
            particlePrototype.ParticleColor = explosionColor;
            particlePrototype.DeltaScale =  0.03f;
            particlePrototype.DeltaAlpha = -0.03f;

            this.circleGenerator = new CircleParticleGenerator(OGE.CurrentWorld.ExplosionEffectSystem, particlePrototype);
            this.circleGenerator.AngleDisplacement = 20;
            this.circleGenerator.InterDistance = 10;
            this.circleGenerator.NumberOfCircles = (int)MathHelper.Clamp((radius / 100), 1, 4);
            this.circleGenerator.ParticleTexture = ParticleTextureType.BlurredCircle;
            this.circleGenerator.Speed = 4f;

            this.circleGenerator.GenerateParticles(Position);
            OGE.CurrentWorld.LightingEffectSystem.GenerateLightSource(position, new Vector2(2 * radius, 2 * radius), explosionColor, -0.01f);
            OGE.CurrentWorld.AdditiveWhite.Alpha += AdditiveWhite;
            OGE.WorldCamera.ShackCamera(10, 0.25f);

            this.EntityCollisionType = CollisionType.Explosion;

            SoundManager.EmitterPosition = Position;
            SoundManager.PlaySFX("explosion");

            this.removalAlarm = new Alarm(0.08f, TweenType.OneShot, new AlarmFinished(RemoveEntity));
            AddTween(removalAlarm, true);
        }
        public HackintoshEnemy()
            : base(new Color(50,50,50))
        {
            InsideScreen = true;

            maxSpeed = SPEED_UNIT;
            acceleration = 0f;

            direction = random.Next(0);
            rotationSpeed = 0f;

            health = 300f;
            damage = 0f;
            score = 500;

            enemyStatus = EnemyStatus.Enterance;

            CurrentImages.Add(new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Enemies\Hackintosh")));
            CurrentImages[0].CenterOrigin();
            CurrentImages[0].Scale = 0;

            AddCollisionMask(new HitboxMask(CurrentImages[0].Width, CurrentImages[0].Height,
                CurrentImages[0].OriginX, CurrentImages[0].OriginY));

            Particle particlePrototype = new Particle();
            particlePrototype.ParticleColor = enemyColor;
            particlePrototype.DeltaScale = -0.08f;
            particlePrototype.DeltaAlpha = -0.08f;

            this.circleGenerator = new CircleParticleGenerator(OGE.CurrentWorld.TrailEffectSystem, particlePrototype);
            this.circleGenerator.AngleDisplacement = 45;
            this.circleGenerator.InterDistance = 5;
            this.circleGenerator.StartingDistance = 5;
            this.circleGenerator.NumberOfCircles = 1;
            this.circleGenerator.ParticleTexture = ParticleTextureType.BlurredCircle;
            this.circleGenerator.Speed = 4f;
            this.circleGenerator.Scale = 0.1f;

            this.generateAlarm = new Alarm(3f, TweenType.Looping, new AlarmFinished(GenerateVirus));
            AddTween(generateAlarm, true);
        }
Beispiel #3
0
        public BaseObject(double timeTillRemove, Color removalColor)
        {
            this.removalAlarm = new Alarm(timeTillRemove, TweenType.OneShot, new AlarmFinished(RemoveEntity));
            AddTween(removalAlarm, true);
            this.removalColor = removalColor;

            this.notifingAlarm = new Alarm(0.8f, TweenType.Looping, GenerateNotifier);
            AddTween(this.notifingAlarm, true);

            Particle particlePrototype = new Particle();
            particlePrototype.ParticleColor = removalColor;
            particlePrototype.DeltaScale = 0.03f;
            particlePrototype.DeltaAlpha = -0.03f;

            this.circleGenerator = new CircleParticleGenerator(OGE.CurrentWorld.TrailEffectSystem, particlePrototype);
            this.circleGenerator.AngleDisplacement = 30;
            this.circleGenerator.NumberOfCircles = 1;
            this.circleGenerator.ParticleTexture = ParticleTextureType.BlurredCircle;
            this.circleGenerator.Speed = 1f;
            this.circleGenerator.Scale = 0.5f;

            EntityCollisionType = CollisionType.Object;
        }
Beispiel #4
0
        public HackintoshBoss()
            : base(new Vector2(OGE.CurrentWorld.Dimensions.X / 2, OGE.CurrentWorld.Dimensions.Y / 2 - 200))
        {
            this.status = BossState.Wait;

            Texture2D texture = OGE.Content.Load<Texture2D>(@"Graphics\Entities\Bosses\HackintoshBoss");

            this.images.Add(BossState.Wait, new Image(texture));

            foreach (Image image in this.images.Values)
            {
                image.CenterOrigin();
            }

            this.actions.Add(BossState.Wait, Wait);

            this.maxHealth = 15000;
            this.health = this.maxHealth;

            this.acceleration = 0;
            this.Direction = 90;
            this.maxSpeed = 0;
            this.speed = 0;
            this.slidingFactor = 0;
            this.freezeResistance = 1f;

            this.damage = 0;
            this.enemyColor = new Color(255, 255, 80);
            this.score = 5000;
            this.CurrentImage = images[status];

            Particle particlePrototype = new Particle();
            particlePrototype.ParticleColor = enemyColor;
            particlePrototype.DeltaScale = -0.08f;
            particlePrototype.DeltaAlpha = -0.08f;

            this.circleGenerator = new CircleParticleGenerator(OGE.CurrentWorld.TrailEffectSystem, particlePrototype);
            this.circleGenerator.AngleDisplacement = 45;
            this.circleGenerator.InterDistance = 5;
            this.circleGenerator.StartingDistance = 15;
            this.circleGenerator.NumberOfCircles = 1;
            this.circleGenerator.ParticleTexture = ParticleTextureType.BlurredCircle;
            this.circleGenerator.Speed = 4f;
            this.circleGenerator.Scale = 1f;

            this.waitAlarm = new Alarm(waitingTime, TweenType.Looping, Disappear);
            this.generatingAlarm = new Alarm(generatingTime, TweenType.Looping, Generate);
            AddTween(this.waitAlarm, true);
            AddTween(this.generatingAlarm, true);

            this.enemyTypes = new List<Type>();
            this.enemyTypes.Add(typeof(VirusEnemy));
            this.enemyTypes.Add(typeof(TroyEnemy));
            this.enemyTypes.Add(typeof(Troy2Enemy));
            this.enemyTypes.Add(typeof(DOSEnemy));
            this.enemyTypes.Add(typeof(DOS2Enemy));
            this.enemyTypes.Add(typeof(WormEnemy));
            this.enemyTypes.Add(typeof(SlowEnemy));

            this.hackintoshFanController = new HackintoshBossFanController(this, 40);
            OGE.CurrentWorld.AddEntity(hackintoshFanController);

            AddCollisionMask(new HitboxMask(110, 110, 55, 55));
        }