public override void Added()
		{
			base.Added();

			// Create main spell particle system
			Particle_Spray = new ParticleSystem( X, Y );
            Particle_Spray.Initialize(10, 10, 0, 360, 15, 15, "../../resources/particle/water_circle.png", 87, 87, 1.5f);
            Particle_Spray.beginColour = Color.White;
            Particle_Spray.endColour = (Color.Blue * Color.Gray * Color.Gray);
            Particle_Spray.endColour.A = 0;
            Particle_Spray.particleShake = 4;
            Particle_Spray.particleStartRotation = Rand.Float(-360, 360);
            Particle_Spray.particleEndRotation = Rand.Float(-360, 360);
            Particle_Spray.Start();
            Scene.Add(Particle_Spray);


            GroundSplat = new Otter.Image("../../resources/particle/splash.png");
            GroundSplat.Color = Color.Cyan;
            GroundSplat.Scale = 2.5f;
            GroundSplat.Color.A = 0.4f;

            GroundTrail = new Otter.Image("../../resources/particle/splash.png");
            GroundTrail.Color = Color.Cyan;
			GroundTrail.Color.A = 0.2f;

			// Remove default audio sample
			AudioLoop.Stop();
			AudioLoop = null;

			// Initialize the fire audio loop
			AudioLoop = new Sound( "../../resources/audio/water.wav", true );
			AudioLoop.Attenuation = 0.1f;
			AudioLoop.Play();
		}
Beispiel #2
0
		public override void Added()
		{
			base.Added();

			// Create main fireball particle system
			Particle_Fire = new ParticleSystem( X, Y );
			Particle_Fire.Initialize( 50, 20, 0, 360, 5, 15, "../../resources/particle/fire.png", 87, 87, 0.8f );
			Particle_Fire.beginColour = Color.Orange + ( Color.Yellow * Color.Gray * Color.Gray );
			Particle_Fire.endColour = Color.Red;
			Particle_Fire.endColour.A = 0;
			Particle_Fire.particleLocalSpace = true;
			Particle_Fire.Start();
			Scene.Add( Particle_Fire );

			// Create fireball trail particle system
			Particle_Fire_Trail = new ParticleSystem( X, Y );
			Particle_Fire_Trail.Initialize( 100, 20, 0, 180, 5, 10, "../../resources/particle/fire.png", 87, 87, 0.8f );
			Particle_Fire_Trail.beginColour = Color.Orange + ( Color.Yellow * Color.Gray * Color.Gray );
			Particle_Fire_Trail.endColour = Color.Red;
			Particle_Fire_Trail.endColour.A = 0;
			Particle_Fire_Trail.Start();
			Scene.Add( Particle_Fire_Trail );

			GroundSplat = new Otter.Image( "../../resources/particle/ground_explosion.png" );

			// Remove default audio sample
			AudioLoop.Stop();
			AudioLoop = null;

			// Initialize the fire audio loop
			AudioLoop = new Sound( "../../resources/audio/fire.wav", true );
			AudioLoop.Attenuation = 0.1f;
			AudioLoop.Play();
		}
Beispiel #3
0
		public override void Added()
		{
			base.Added();

			// Create main fire ball particle system
			Particle_Dust = new ParticleSystem( X, Y );
			Particle_Dust.Initialize( 50, 20, 0, 360, 5, 15, "../../resources/particle/smoke.png", 87, 87, 0.8f );
			Particle_Dust.particleShake = 1;
			Particle_Dust.beginColour = Color.Gray * Color.Gray * Color.Orange + Color.Gray;
			Particle_Dust.beginColour.A = 0.5f;
			Particle_Dust.endColour = Color.Black;
			Particle_Dust.endColour.A = 0;
			Particle_Dust.particleEndScale = 5.0f;
			Particle_Dust.particleStartRotation = Rand.Float( -720, 720 );
			Particle_Dust.particleEndRotation = Rand.Float( -720, 720 );
			Particle_Dust.particleLocalSpace = true;
            Particle_Dust.Start();
			Scene.Add( Particle_Dust );

			// Intitialize the ground trail mark image
			GroundTrail = new Otter.Image( "../../resources/particle/scorch.png" );

			// Initialize trail mark timers to seconds
			TrailBetween = TRAIL_BETWEEN * 60;
			TrailBetweenRandom = TRAIL_BETWEEN_RANDOM * 60;

			// Remove default audio sample
			AudioLoop.Stop();
			AudioLoop = null;

			// Initialize the dust storm audio loop
			AudioLoop = new Sound( "../../resources/audio/dust.wav", true );
			AudioLoop.Attenuation = 0.1f;
			AudioLoop.Play();
		}
        public void DropBombs()
        {
            Sound bip = new Sound(Assets.SFX_CHARGE);
            bip.Volume = 0.9f;
            bip.Play();

            // Create 8 missiles
            for (int i = 0; i < 8; i++)
            {
                Missile newMissile = new Missile(X, Y);
                newMissile.Graphic.Angle = Rand.Float(0, 360);
                this.Scene.Add(newMissile);
            }
            Global.Bombs--;
        }
Beispiel #5
0
		public override void Added()
		{
			base.Added();

			// Initialie collider
			SetHitbox( 10, 10, ( (int) ColliderType.Spell ) + ID );
			Hitbox.CenterOrigin();

			// Initialize trail mark timers to seconds
			TrailBetween = TRAIL_BETWEEN * 60;
			TrailBetweenRandom = TRAIL_BETWEEN_RANDOM * 60;

			// Initialize the default audio loop
			AudioLoop = new Sound( "../../resources/audio/magichappens.wav", true );
			AudioLoop.Attenuation = 0.1f;
			AudioLoop.Play();
		}
        public override void Removed()
        {
            // Create paff
            Particle paff = new Particle(X, Y, Assets.GFX_MISSILEBREAK, 32, 32);

            paff.LifeSpan = 10.0f;
            paff.FrameCount = 6;
            paff.FinalAlpha = 1.0f;
            paff.Image.CenterOrigin();

            this.Scene.Add(paff);
            Sound bip = new Sound(Assets.SFX_BOOM);
            bip.Volume = 0.9f;
            bip.Pitch = Rand.Float(0.8f, 1.2f);
            bip.Play();

            base.Removed();
        }
        public override void Update()
        {
            base.Update();

            // Fly towards player
            Vector2 VectorToPlayer = new Vector2(Global.theGhost.X - X, Global.theGhost.Y - Y - 10);

            if(VectorToPlayer.Length < 2)
            {
                Global.Score++;
                Sound bip = new Sound(Assets.SFX_GET);
                bip.Volume = 0.6f;

                bip.Pitch = Rand.Float(0.8f, 1.2f);
                bip.Play();
                RemoveSelf();
                //Global.theMusic.Pitch += 0.01f;
            }

            VectorToPlayer.Normalize();
            X += VectorToPlayer.X * 3;
            Y += VectorToPlayer.Y * 3;
        }
		public override void Added()
		{
			base.Added();

			float offsetsin = Rand.Float( -180, 180 );

			// Create first vine
			VineSineOne = new SineWave( 5, 1, offsetsin );
			VineOne = new ParticleSystem( X, Y - VineSineOne.Value * 100 );
			VineOne.Initialize( 0, 0, 0, 0, 1, 60, "../../resources/particle/vine.png", 87, 87, 0.3f );
			VineOne.beginColour = Color.Orange * Color.Gray;
			VineOne.endColour = ( Color.Green * Color.Gray * Color.Red );
			VineOne.endColour.A = 0;
			VineOne.particleShake = 4;
			VineOne.particleStartRotation = ( VineSineOne.Value * ( 180.0f / (float) Math.PI ) ) * 2;
			VineOne.particleEndRotation = VineOne.particleStartRotation;
			VineOne.Start();
			Scene.Add( VineOne );
			this.AddComponent( VineSineOne );

			// Create second vine
			VineSineTwo = new SineWave( 5, 1, 180.0f + offsetsin );
			VineTwo = new ParticleSystem( X, Y - VineSineTwo.Value * 100 );
			VineTwo.Initialize( 0, 0, 0, 0, 1, 60, "../../resources/particle/vine.png", 87, 87, 0.3f );
			VineTwo.beginColour = Color.Orange * Color.Gray;
			VineTwo.endColour = ( Color.Green * Color.Gray * Color.Red );
			VineTwo.endColour.A = 0;
			VineTwo.particleShake = 4;
			VineTwo.particleStartRotation = ( VineSineTwo.Value * ( 180.0f / (float) Math.PI ) ) * 2;
			VineTwo.particleEndRotation = VineTwo.particleStartRotation;
			VineTwo.Start();
			Scene.Add( VineTwo );
			this.AddComponent( VineSineTwo );

			GroundTrail = new Otter.Image( "../../resources/particle/leaf.png" );
			GroundTrail.Color = Color.Green * Color.Gray * Color.Yellow;

			TrailBetween = 5;
			TrailBetweenRandom = 5;

			// Remove default audio sample
			AudioLoop.Stop();
			AudioLoop = null;

			// Initialize the fire audio loop
			AudioLoop = new Sound( "../../resources/audio/vine.wav", true );
			AudioLoop.Attenuation = 0.1f;
			AudioLoop.Play();
		}
        public override void Update()
        {
            base.Update();

            // Input & Movement
            if (!Impostor)
            {
                HandleInput();
            }
            else
            {
                HandleImpostorInput();
            }

            X += mySpeed.X;
            Y += mySpeed.Y;

            if (RefireTime > 0.0f)
            {
                RefireTime--;
            }

            // Hit By Laser
            if (Collider.Overlap(X, Y, 3) && hurtTime <= 0.0f)
            {
                // Got hurt!
                hurtTime = 45.0f;
                Global.theCamShaker.ShakeCamera(20.0f);

                // reduce score / screw with music
                Global.Score -= 10 + ((Global.Score / 100) * 10);
                //Global.theMusic.Pitch -= 0.01f;
                Sound bip = new Sound(Assets.SFX_HURT);
                bip.Volume = 0.9f;
                bip.Play();
            }
        }
        public void ShootInDirection(Vector2 shootAxis)
        {
            // Shoot stars
            if ((shootAxis.Length > 0.9) && RefireTime <= 0.0 && hurtTime <= 0.0)
            {
                RefireTime = MaxRefire;

                float XSpeedOfStar = 4.0f * shootAxis.X;
                float YSpeedOfStar = 4.0f * shootAxis.Y;

                Star newStar = new Star(X, Y, XSpeedOfStar, YSpeedOfStar);
                this.Scene.Add(newStar);
                Sound bip = new Sound(Assets.SFX_SHOOT);
                bip.Volume = 0.9f;
                bip.Play();

                mySpeed.X -= shootAxis.X * 0.2f;
                mySpeed.Y -= shootAxis.Y * 0.2f;

            }
        }
        public void FireLaser()
        {
            mySprite.Play("fire");
            CurrentActivity = 2;
            CurrentFireTime = 0;
            FireDir = Rand.Bool;

            // capture player location/angle relative to us
            TargetPos = new Vector2(Global.theGhost.X, Global.theGhost.Y);
            Sound bip = new Sound(Assets.SFX_DRONEFIRE);
            bip.Volume = 0.3f;
            bip.Play();
        }
        public override void Update()
        {
            base.Update();
            if(CurrentActivity == 0)
            {
                //nada
            }

            if(CurrentActivity == 1)
            {
                // charging laser
                if(ChargeTime < MaxChargeTime)
                {
                    ChargeTime++;
                    //update anim
                    mySprite.Anim("charge").Speed((ChargeTime / (MaxChargeTime)) * 4);

                    // drift towards player
                    Vector2 VectorToPlayer = new Vector2(Global.theGhost.X - X, Global.theGhost.Y - Y);

                    if(VectorToPlayer.Length > 500)
                    {
                        // teleport to player
                        X = Rand.Float(Global.theGhost.X - 400, Global.theGhost.X + 400);
                        Y = Rand.Float(Global.theGhost.Y - 400, Global.theGhost.Y + 400);
                    }

                    VectorToPlayer.Normalize();
                    X += VectorToPlayer.X * 0.5f;
                    Y += VectorToPlayer.Y * 0.5f;
                }
                else
                {
                    FireLaser();
                }
            }
            if(CurrentActivity == 2)
            {
                // firing laser
                if(CurrentFireTime < MaxFireTime)
                {
                    CurrentFireTime++;
                    // create laser particles, aim at player, then tween angle displacement slowly
                    float ProgressThroughFire = CurrentFireTime / MaxFireTime;
                    Vector2 VectorToPlayer = new Vector2(TargetPos.X - X, TargetPos.Y - Y);
                    float AngleToPlayer = (float)Math.Atan2(VectorToPlayer.Y, VectorToPlayer.X);
                    AngleToPlayer *= (float)(180.0 / Math.PI);
                    if(FireDir)
                    {
                        AngleToPlayer += (-15) + (ProgressThroughFire * 30);
                    }
                    else
                    {
                        AngleToPlayer -= (-15) + (ProgressThroughFire * 30);
                    }

                    AngleToPlayer *= (float)(Math.PI / 180.0);
                    Laser newLaser = new Laser(X, Y, (float)Math.Cos(AngleToPlayer) * 7, (float)Math.Sin(AngleToPlayer) * 7);
                    this.Scene.Add(newLaser);

                }
                else
                {
                    ChargeUpLaser();
                }

            }

            if(CurrentActivity == 3)
            {
                RemoveColliders(Collider);
                mySprite.Play("dead");
                return;
            }

            if(Collider.Overlap(X, Y, 1))
            {
                // Hit by star, die
                // spawn music note & particles
                Hits--;
                if(Hits <= 0)
                {
                    this.Scene.Add(new Note(X, Y));
                    int maxSpawn = 1 + ((int)Global.Score / 200);
                    for (int i = 0; i < maxSpawn; i++)
                    {
                        this.Scene.Add(new Drone(Rand.Float(Global.theGhost.X - 400, Global.theGhost.X + 400), Rand.Float(Global.theGhost.Y - 400, Global.theGhost.Y + 400), maxSpawn * 2));
                    }
                    CurrentActivity = 3;
                    mySprite.OriginY -= 14;
                    Layer = 10;
                    mySprite.ShakeX = 3;
                    Sound bip = new Sound(Assets.SFX_HURT);
                    bip.Volume = 0.9f;
                    bip.Pitch = Rand.Float(0.8f, 1.2f);
                    bip.Play();
                }

            }
        }
Beispiel #13
0
		public override void Added()
		{
			base.Added();

			// Add base rock image to projectile
			Graphic = new Otter.Image( "../../resources/particle/rock" + Rand.Int( 1, IMAGE_ROCKS ) + ".png" );
			Graphic.CenterOrigin();

			// Add the circling smaller rocks
			int extras = ROCK_EXTRA + Rand.Int( -ROCK_EXTRA_RANDOM, ROCK_EXTRA_RANDOM );
			for ( int extra = 1; extra <= extras; extra++ )
			{
				AddGraphic( new Otter.Image( "../../resources/particle/rock_small" + Rand.Int( 1, IMAGE_ROCKS_SMALL ) + ".png" ) );
				Graphics[extra].OriginX = -ROCK_EXTRA_OFFSET;
				Graphics[extra].OriginY = -ROCK_EXTRA_OFFSET;
				Graphics[extra].Angle = 360 / extras * extra;
			}

			// Create main fire ball particle system
			Particle_Dust = new ParticleSystem( X, Y );
			Particle_Dust.Initialize( 50, 20, 0, 360, 1, 15, "../../resources/particle/smoke.png", 87, 87, 0.8f );
			Particle_Dust.particleShake = 1;
			Particle_Dust.beginColour = Color.Gray * Color.Gray * Color.Orange + Color.Gray;
			Particle_Dust.beginColour.A = 0.5f;
			Particle_Dust.endColour = Color.Black;
			Particle_Dust.endColour.A = 0;
			Particle_Dust.particleStartScale = 0.1f;
			Particle_Dust.particleEndScale = 1.0f;
			Particle_Dust.particleStartRotation = Rand.Float( -720, 720 );
			Particle_Dust.particleEndRotation = Rand.Float( -720, 720 );
			Particle_Dust.particleLocalSpace = true;
			Particle_Dust.Start();
			Scene.Add( Particle_Dust );

			// Intitialize the ground trail mark image
			GroundTrail = new Otter.Image( "../../resources/particle/scorch.png" );

			// Initialize trail mark timers to seconds
			TrailBetween = TRAIL_BETWEEN * 60;
			TrailBetweenRandom = TRAIL_BETWEEN_RANDOM * 60;

			// Remove default audio sample
			AudioLoop.Stop();
			AudioLoop = null;

			// Initialize the dust storm audio loop
			AudioLoop = new Sound( "../../resources/audio/dust.wav", true );
			AudioLoop.Attenuation = 0.1f;
			AudioLoop.Play();
		}