예제 #1
0
 public static void GoToTotem(Totem totem, float time, int pickupOffset)
 {
     moveToTotem.StartPosition = Game1.GameCamera.Transform.Position;
     moveToTotem.Target        = new Vector2(totem.Transform.PosX, CameraHeightOnGround);
     currentTotemPosition      = totem.Transform.PosX;
     crowd.PickupPlayer(time, pickupOffset);
     actionManager.StartNew(gotoFirstTotem);
 }
예제 #2
0
 public static void ThrowPlayer(Totem totem)
 {
     crowd.LaunchPlayer();
     Game1.player.Initialise(totem);
     moveToAscendingPlayer.Start.Position = Game1.GameCamera.Transform.Position;
     cutscenePlayer.Launch(totem);
     moveToAscendingPlayer.Timer.Interval = cutscenePlayer.AscendDuration;             //Total time of animation = crowd stretch + throwing time
     actionManager.StartNew(playerLaunch);
 }
예제 #3
0
 //Pour debug
 public void StartDebug(Totem totem)
 {
     m_totemInstance  = totem;
     m_transform.PosX = 0;
     m_transform.PosY = totem.Top + DeltaAboveClimbingAltitude;
     isFalling        = true;
     Game1.startingCountdown.activateCountdown();
     Game1.isInGameplay = true;
     isVisible          = true;
 }
예제 #4
0
 public void Initialise(Totem totem)
 {
     m_totemInstance            = totem;
     m_transform.PosX           = totem.Transform.PosX;
     m_transform.PosY           = totem.Top + DeltaAboveClimbingAltitude;
     m_spriteTransform.Position = m_leftTransform.Position;
     isToLeft        = true;
     isVisible       = false;
     isFalling       = false;
     SpeedMultiplier = 1.0f;
     ComboCount      = 1;
 }
예제 #5
0
        protected void Push(Player player, float force)
        {
            m_physics.Throw(force, -5, (float)Program.Random.NextDouble());
            m_physics.GroundLevel = 0;
            m_totemInstance.Detach(this);

            if (m_below != null)
            {
                m_below.m_above = m_above;
            }
            if (m_above != null)
            {
                m_above.ChainPush();
                m_above.m_below = m_below;
            }

            float previous = Top;

            m_sprite.Origin = new Vector2(0.5f, 0.5f);
            float next = Top;

            m_transform.Position       += m_transform.ParentTransform.PositionGlobal;
            m_transform.PosY           -= next - previous;
            m_transform.ParentTransform = null;
            m_totemInstance             = null;
            m_below = null;
            m_above = null;

            if (Game1.old_kbs.IsKeyDown(Keys.Space))
            {
                m_transform.Scale = new Vector2(0);
                m_explosion.Generate(10, new Object[] { m_transform.PositionGlobal, player });
            }

            if (player.ComboCount >= Game1.scoreBorder.ScoreMultiplierMax)
            {
                m_generator.Generate(Game1.scoreBorder.ScoreMultiplierMax, new object[] { m_transform.PositionGlobal, player });
            }
            else
            {
                m_generator.Generate(player.ComboCount, new object[] { m_transform.PositionGlobal, player });
            }
        }
예제 #6
0
        public void LoadLevel(int index)
        {
            string path = "Level_" + index;

            totems[0] = new Totem();
            totems[0].BuildFromFile(path + "/Level" + index + "_1");
            totems[1] = new Totem();
            totems[1].BuildFromFile(path + "/Level" + index + "_2");
            if (index == 0)
            {
                totems[2] = null;
            }
            else
            {
                totems[2] = new Totem();
                totems[2].BuildFromFile(path + "/Level" + index + "_3");
            }

            totems[0].HidePowerUp();
            totems[1].HidePowerUp();
            if (totems[2] != null)
            {
                totems[2].HidePowerUp();
            }

            int maxIndex = 3;

            if (index == 0)
            {
                maxIndex = 2;
            }
            for (int i = 0; i < maxIndex; ++i)
            {
                SoundEffectInstance musicL1 = SoundEffectLibrary.Get("music_T" + index + "P" + (i + 1) + "L1").CreateInstance();
                SoundEffectInstance musicL2 = SoundEffectLibrary.Get("music_T" + index + "P" + (i + 1) + "L2").CreateInstance();
                SoundEffectInstance musicL3 = SoundEffectLibrary.Get("music_T" + index + "P" + (i + 1) + "L3").CreateInstance();
                SoundEffectInstance musicL4 = SoundEffectLibrary.Get("music_T" + index + "P" + (i + 1) + "L4").CreateInstance();
                musics[i] = new DynamicMusic(musicL1, musicL2, musicL3, musicL4);
            }

            PlaceTotems();
        }
예제 #7
0
        public void Launch(Totem totem)
        {
            m_totemInstance = totem;
            if (m_transform.ParentTransform != null)
            {
                m_transform.Position += m_transform.ParentTransform.PositionGlobal;
            }
            m_transform.ParentTransform = null;

            //Ascend movement
            m_ascendMovement.Start.Position  = m_transform.Position;
            m_ascendMovement.Start.Direction = m_transform.Direction + Math.PI * 4;
            m_ascendMovement.End.Position    = Game1.player.SpriteTransform.PositionGlobal + new Vector2(CharacterOffsetToPlayerX, CharacterOffsetToPlayerY);
            m_ascendMovement.Timer.Interval  = AscendDuration;

            //Sword
            m_sword.Transform.ParentTransform = m_transform;
            m_swordDelay.Timer.Interval       = AscendDuration * SwordStartTimeRatio;
            m_swordMovement.Start.Position    = new Vector2(SwordStartX, SwordStartY);
            m_swordMovement.Start.Direction   = SwordStartAngle;
            m_swordMovement.Timer.Interval    = AscendDuration * (1 - SwordStartTimeRatio);
            m_sword.IsVisible          = true;
            m_sword.Transform.Position = m_swordMovement.Start.Position;
            m_actionManager.StartNew(m_ascend);

            //Cloud
            m_cloud.Transform.ParentTransform = m_transform;
            m_cloudMovement.Timer.Interval    = AscendDuration * (1 - SwordStartTimeRatio);
            m_cloud.IsVisible          = true;
            m_cloud.Transform.Position = m_cloudMovement.StartPosition;

            //Shling
            m_shlingSprite.Transform.ScaleUniform = 0.0f;
            m_sprite.SetFrame(0);
            SetOriginMiddle();
        }
예제 #8
0
        public void LoadTutorialLevel(int index)
        {
            string path = "Tutorial";

            totems[0] = new Totem();
            totems[0].BuildFromFile(path + "/Tutorial_1");
            totems[1] = new Totem();
            totems[1].BuildFromFile(path + "/Tutorial_2");
            totems[2] = new Totem();
            totems[2].BuildFromFile(path + "/Tutorial_3");

            totems[0].HidePowerUp();
            totems[1].HidePowerUp();
            totems[2].HidePowerUp();

            int maxIndex = 3;
            if (index == 0)
                maxIndex = 2;
            for (int i = 0; i < maxIndex; ++i)
            {
                SoundEffectInstance musicL1 = SoundEffectLibrary.Get("music_T" + index + "P" + (i + 1) + "L1").CreateInstance();
                SoundEffectInstance musicL2 = SoundEffectLibrary.Get("music_T" + index + "P" + (i + 1) + "L2").CreateInstance();
                SoundEffectInstance musicL3 = SoundEffectLibrary.Get("music_T" + index + "P" + (i + 1) + "L3").CreateInstance();
                SoundEffectInstance musicL4 = SoundEffectLibrary.Get("music_T" + index + "P" + (i + 1) + "L4").CreateInstance();
                musics[i] = new DynamicMusic(musicL1, musicL2, musicL3, musicL4);
            }

            PlaceTotems();
        }
예제 #9
0
        public void LoadRandomLevel()
        {
            totems[0] = new Totem();
            totems[0].AddSections(new SectionData(typeof(NormalSection), 0, 0, 10));
            totems[0].AddSections(new SectionData(typeof(MetalSection), 8, 8, 4));
            totems[0].AddSections(new SectionData(typeof(SpikeSection), 4, 4, 2));
            totems[0].BuildRandom();

            totems[1] = new Totem();
            totems[1].AddSections(new SectionData(typeof(NormalSection), 0, 0, 10));
            totems[1].AddSections(new SectionData(typeof(MetalSection), 8, 8, 4));
            totems[1].AddSections(new SectionData(typeof(SpikeSection), 4, 4, 2));
            totems[1].BuildRandom();

            totems[2] = new Totem();
            totems[2].AddSections(new SectionData(typeof(NormalSection), 0, 0, 10));
            totems[2].AddSections(new SectionData(typeof(MetalSection), 8, 8, 4));
            totems[2].AddSections(new SectionData(typeof(SpikeSection), 4, 4, 2));
            totems[2].BuildRandom();

            for (int i = 0; i < 3; ++i)
            {
                SoundEffectInstance musicL1 = SoundEffectLibrary.Get("music_T1P" + (i + 1) + "L1").CreateInstance();
                SoundEffectInstance musicL2 = SoundEffectLibrary.Get("music_T1P" + (i + 1) + "L2").CreateInstance();
                SoundEffectInstance musicL3 = SoundEffectLibrary.Get("music_T1P" + (i + 1) + "L3").CreateInstance();
                SoundEffectInstance musicL4 = SoundEffectLibrary.Get("music_T1P" + (i + 1) + "L4").CreateInstance();
                musics[i] = new DynamicMusic(musicL1, musicL2, musicL3, musicL4);
            }

            PlaceTotems();
        }
예제 #10
0
 public static void ThrowPlayer(Totem totem)
 {
     crowd.LaunchPlayer();
     Game1.player.Initialise(totem);
     moveToAscendingPlayer.Start.Position = Game1.GameCamera.Transform.Position;
     cutscenePlayer.Launch(totem);
     moveToAscendingPlayer.Timer.Interval = cutscenePlayer.AscendDuration; //Total time of animation = crowd stretch + throwing time
     actionManager.StartNew(playerLaunch);
 }
예제 #11
0
 public static void GoToTotem(Totem totem, float time, int pickupOffset)
 {
     moveToTotem.StartPosition = Game1.GameCamera.Transform.Position;
     moveToTotem.Target = new Vector2(totem.Transform.PosX, CameraHeightOnGround);
     currentTotemPosition = totem.Transform.PosX;
     crowd.PickupPlayer(time, pickupOffset);
     actionManager.StartNew(gotoFirstTotem);
 }
예제 #12
0
        public void Launch(Totem totem)
        {
            m_totemInstance = totem;
            if(m_transform.ParentTransform != null)
                m_transform.Position += m_transform.ParentTransform.PositionGlobal;
            m_transform.ParentTransform = null;

            //Ascend movement
            m_ascendMovement.Start.Position = m_transform.Position;
            m_ascendMovement.Start.Direction = m_transform.Direction + Math.PI * 4;
            m_ascendMovement.End.Position = Game1.player.SpriteTransform.PositionGlobal + new Vector2(CharacterOffsetToPlayerX, CharacterOffsetToPlayerY);
            m_ascendMovement.Timer.Interval = AscendDuration;

            //Sword
            m_sword.Transform.ParentTransform = m_transform;
            m_swordDelay.Timer.Interval = AscendDuration * SwordStartTimeRatio;
            m_swordMovement.Start.Position = new Vector2(SwordStartX, SwordStartY);
            m_swordMovement.Start.Direction = SwordStartAngle;
            m_swordMovement.Timer.Interval = AscendDuration * (1 - SwordStartTimeRatio);
            m_sword.IsVisible = true;
            m_sword.Transform.Position = m_swordMovement.Start.Position;
            m_actionManager.StartNew(m_ascend);

            //Cloud
            m_cloud.Transform.ParentTransform = m_transform;
            m_cloudMovement.Timer.Interval = AscendDuration * (1 - SwordStartTimeRatio);
            m_cloud.IsVisible = true;
            m_cloud.Transform.Position = m_cloudMovement.StartPosition;

            //Shling
            m_shlingSprite.Transform.ScaleUniform = 0.0f;
            m_sprite.SetFrame(0);
            SetOriginMiddle();
        }
예제 #13
0
 public void PlaceOnTotem(Totem totem, TotemSection sectionAbove, TotemSection sectionBelow)
 {
     m_totemInstance = totem;
     m_above         = sectionAbove;
     m_below         = sectionBelow;
 }
예제 #14
0
        protected void Push(Player player, float force)
        {
            m_physics.Throw(force, -5, (float)Program.Random.NextDouble());
            m_physics.GroundLevel = 0;
            m_totemInstance.Detach(this);

            if(m_below != null)
                m_below.m_above = m_above;
            if (m_above != null)
            {
                m_above.ChainPush();
                m_above.m_below = m_below;
            }

            float previous = Top;
            m_sprite.Origin = new Vector2(0.5f, 0.5f);
            float next = Top;
            m_transform.Position += m_transform.ParentTransform.PositionGlobal;
            m_transform.PosY -= next - previous;
            m_transform.ParentTransform = null;
            m_totemInstance = null;
            m_below = null;
            m_above = null;

            if (Game1.old_kbs.IsKeyDown(Keys.Space))
            {
                m_transform.Scale = new Vector2(0);
                m_explosion.Generate(10, new Object[] { m_transform.PositionGlobal, player });
            }

            if (player.ComboCount >= Game1.scoreBorder.ScoreMultiplierMax)
            {
                m_generator.Generate(Game1.scoreBorder.ScoreMultiplierMax, new object[] { m_transform.PositionGlobal, player });
            }
            else
            {
                m_generator.Generate(player.ComboCount, new object[] { m_transform.PositionGlobal, player });
            }
        }
예제 #15
0
 public void PlaceOnTotem(Totem totem, TotemSection sectionAbove, TotemSection sectionBelow)
 {
     m_totemInstance = totem;
     m_above = sectionAbove;
     m_below = sectionBelow;
 }