Exemple #1
0
 public DrDogMinion2Bullet(Vector2 position_)
 {
     Choom.PlayEffect(SoundAssets.LaserShot);
     position = position_;
     velocity = new Vector2(-DrDogMinion2.fire_speed, 0);
     size     = new Vector2(30, 30);
 }
Exemple #2
0
        protected override void OuttroFinished()
        {
            transitionID = MenuState.None; /* reset it for next time */
            Choom.Pause(false);

            base.OuttroFinished();
        }
Exemple #3
0
 public PeterMissile(Vector2 position_)
 {
     Choom.PlayEffect(SoundAssets.Gatling[Util.rng.Next(SoundAssets.Gatling.Length)]);
     position = position_;
     angle    = Util.rng.NextFloat(-2 * (float)Math.PI * 8 / 6, -2 * (float)Math.PI);
     velocity = Util.fromPolar(angle, 1.0f);
 }
Exemple #4
0
        public override void tick()
        {
            frame += 15;
            if (time++ % 20 == 0)
            {
                Choom.PlayEffect(SoundAssets.BoomerangShot);
            }

            if (state == State.FIRING)
            {
                position   += velocity;
                velocity.y += HootMinion2.weapon_gravity;
            }
            if (position.x < 250 && hit == false)
            {
                state = State.DYING;
                frame = 0;
                hit   = true;
            }
            if (hit == true && frame > 299)
            {
                remove = true;
                Game.instance.damageTargetPiece(HootMinion2.weapon_damage);
            }
        }
Exemple #5
0
 public HootFlyBullet(Vector2 position_)
 {
     Choom.PlayEffect(SoundAssets.Gatling[Util.rng.Next(SoundAssets.Gatling.Length)]);
     position = position_;
     speed    = HootFly.bulet_speed;
     velocity = new Vector2(-speed, 0);
 }
Exemple #6
0
        public IceCreamTankBullet(Vector2 position_)
        {
            Choom.PlayEffect(SoundAssets.BoomerangShot);

            position = position_;
            velocity = new Vector2(-IceCreamTank.bullet_speed, -IceCreamTank.bullet_yspeed);
        }
Exemple #7
0
        public override void tick()
        {
            dest     = Game.instance.targetDestination();
            velocity = (dest - position).normalized * SkeletonKingMiniboss.frost_speed;
            if (exploding)
            {
                frame += (int)(1000 * SkeletonKingMiniboss.frost_explode_anim_speed / 60);
                if (frame >= 900)
                {
                    remove = true;
                }
                return;
            }

            position += velocity;
            angle     = Util.angle(velocity) + (float)Math.PI;

            if ((position - dest).magnitude < 30)
            {
                Choom.PlayEffect(SoundAssets.HitHouse[Util.rng.Next(SoundAssets.HitHouse.Length)]);
                if (dest == Game.instance.targetDestination())
                {
                    Game.instance.damageTargetPiece(SkeletonKingMiniboss.frost_damage);
                }
                kill();
            }
        }
Exemple #8
0
 public IceCreamFlyer2Bullet(Vector2 position_)
 {
     Choom.PlayEffect(SoundAssets.BoomerangShot);
     position = position_;
     speed    = IceCreamFlyer2.bullet_speed;
     velocity = new Vector2(-speed, 0);
 }
Exemple #9
0
        protected override void OuttroFinished()
        {
            /* record last selected item for if the player returns */
            lastSelected = UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject;

            if (transitionID == MenuState.Title ||
                transitionID == MenuState.None)
            {
                lastSelected = refocusSelected;
            }

            if (transitionID == MenuState.None)
            {
                Choom.Pause(false);

                State game_state = AppMain.top_state.child_state;
                AppMain.top_state.Dispose();
                AppMain.top_state = game_state;

                menu.SetActiveDayName(true);
                AppMain.tutorial.Pause(false);
                lastSelected = refocusSelected;
            }

            transitionID = MenuState.None; /* reset it for next time */

            base.OuttroFinished();
        }
Exemple #10
0
        protected override void IntroReady()
        {
            Choom.Play("Music/credits");
            Choom.Pause(false);

            objectives.CheckComplete();
            Objectives.CheckAchievements();

            if (Objectives.AnyComplete)
            {
                LeanTween.delayedCall(4, () => {
                    menu.ignore_input = false;
                    refocusSelected.SetActive(true);
                    menu.SetFocus(refocusSelected);
                    objectives.Play(HashIDs.menu.Outtro);
                });
            }
            else
            {
                menu.ignore_input = false;
                refocusSelected.SetActive(true);
                menu.SetFocus(refocusSelected);
                objectives.Play(HashIDs.menu.Outtro);
            }

            MenuCredits.DisplayEnding = true;
            MenuCredits.ScrollDelay   = 3;
        }
Exemple #11
0
 public DrDogMissile(Vector2 position_)
 {
     Choom.PlayEffect(SoundAssets.Gatling[Util.rng.Next(SoundAssets.Gatling.Length)]);
     position = position_;
     angle    = Util.rng.NextFloat((float)Math.PI, (float)Math.PI * 8 / 6);
     velocity = Util.fromPolar(angle, 1);
 }
Exemple #12
0
        void OnEnable()
        {
            animator.speed = 0;
            refocusSelected.SetActive(false);

            MetaState.end_game = false;
            AppMain.screenShake(0, 0);
            Choom.StopAllEffects();
            Choom.Pause();

            if (MetaState.wave_number + 1 > DataStorage.StartOnWave)
            {
                DataStorage.StartOnWave = MetaState.wave_number + 1;
            }

            Objectives.BossDefeated();
            Objectives.SurvivedFinalStage();

            Platform.SaveEndWave();
            Objectives.CheckAchievements();

            objectives.UpdateText();

            menu.Fade(0.9f, 0.5f, () => {
                objectives.Play(HashIDs.menu.Intro);
                animator.speed = 1;
            });
        }
Exemple #13
0
 protected override void OuttroStartNextIntro()
 {
     if (DisplayEnding)
     {
         Choom.Play("Music/title");
     }
     base.OuttroStartNextIntro();
 }
Exemple #14
0
 protected override void OuttroStartNextIntro()
 {
     if (transitionID != MenuState.None)
     {
         Choom.Play("Music/title");
         base.OuttroStartNextIntro();
     }
 }
Exemple #15
0
        public override void tick()
        {
            base.tick();
            if (frozenThisFrame())
            {
                return;
            }

            velocity += new Vector2(0, gravity);
            position += velocity;
            if (position.y > 450)
            {
                position.y = 450;
                velocity.y = 0;
            }

            if (state == State.THROWING)
            {
                frame += 10;
                if (frame > 200 && hasthrown == false)
                {
                    hasthrown = true;
                    Game.instance.enemy_bullet_group.add(
                        new HootMinionBullet(position + new Vector2(-10, -10)));
                }
                if (frame > 400)
                {
                    velocity.x = -Util.rng.NextFloat(approach_speed_min, approach_speed_max);
                    state      = State.WALKING;
                }
            }

            if (position.x > 1100)
            {
                remove = true;
            }

            if (state == State.DYING)
            {
                frame += 10;
                if (frame >= 1000)
                {
                    finishDying();
                }
            }

            if (state == State.WALKING)
            {
                frame += (int)(1000 * Util.rng.NextFloat(run_anim_speed_min, run_anim_speed_max) / 60);
                if (position.x < steal_distance)
                {
                    position.x = steal_distance;
                    velocity.x = -velocity.x;
                    Choom.PlayEffect(SoundAssets.OrphanTake);
                    held_orphans.Add(new Orphan(new Vector2(30, -10)));
                }
            }
        }
Exemple #16
0
        protected override void OuttroStartNextIntro()
        {
            if (transitionID != MenuState.None && !AppMain.IsPaused)
            {
                Choom.Play("Music/title");
            }

            base.OuttroStartNextIntro();
        }
Exemple #17
0
 public override void startDying()
 {
     if (state == State.DYING)
     {
         return;
     }
     Choom.PlayEffect(SoundAssets.EnemyDie);
     state = State.DYING;
     frame = 0;
 }
Exemple #18
0
 public PenguinTankBullet(Vector2 position_, float scale_ = 0)
 {
     Choom.PlayEffect(SoundAssets.Gatling[Util.rng.Next(SoundAssets.Gatling.Length)]);
     scale = new Vector2(-1, 1);
     if (scale_ != 0)
     {
         scale *= scale_;
     }
     position = position_;
     velocity = new Vector2(-PenguinTank.bullet_speed, 0);
 }
Exemple #19
0
        public override void tick()
        {
            age += 1 / 60.0f;

            var target_position = Game.instance.targetDestination();

            var dest_velocity = target_position - position;
            var dest_modifier = dest_velocity - velocity;
            var dest_angle    = Util.angle(dest_modifier);

            angle %= (float)Math.PI * 2;
            if (Math.Abs(dest_angle - angle) > Math.Abs(dest_angle + Math.PI * 2 - angle))
            {
                dest_angle += (float)Math.PI * 2;
            }
            if (Math.Abs(dest_angle - angle) > Math.Abs(dest_angle - Math.PI * 2 - angle))
            {
                dest_angle -= (float)Math.PI * 2;
            }

            if (angle < dest_angle)
            {
                angle += DrDog.missile_rotation_speed;
            }
            if (angle > dest_angle)
            {
                angle -= DrDog.missile_rotation_speed;
            }
            if (Math.Abs(dest_angle - angle) < DrDog.missile_rotation_speed)
            {
                angle     = dest_angle;
                velocity += Util.fromPolar(angle, DrDog.missile_acceleration);
            }

            if (velocity.magnitude > DrDog.missile_max_speed)
            {
                velocity = new Vector2(velocity.x, velocity.y).normalized *DrDog.missile_max_speed;
            }

            position += velocity;

            if (position.x < Puzzle.grid_left + Puzzle.piece_size * 3 ||
                age > DrDog.missile_lifetime)
            {
                remove = true;
                Choom.PlayEffect(SoundAssets.HitHouse[Util.rng.Next(SoundAssets.HitHouse.Length)]);
                Game.instance.enemy_bullet_group.add(new Explosion(position, Vector2.zero,
                                                                   20, 0, Gun.Ammo.NONE));
                if (age < DrDog.missile_lifetime)
                {
                    Game.instance.damageTargetPiece(DrDog.missile_damage);
                }
            }
        }
Exemple #20
0
        public override void startDying()
        {
            if (state == (int)drdog_minion.Sprites.drdog_minion_death1)
            {
                return;
            }

            Choom.PlayEffect(SoundAssets.EnemyDie);
            state     = (int)drdog_minion.Sprites.drdog_minion_death1;
            sub_frame = 0;
        }
Exemple #21
0
        public override void startDying()
        {
            if (state == State.DYING)
            {
                return;
            }

            Choom.PlayEffect(SoundAssets.BossDie1);
            state = State.DYING;
            Game.instance.removeBoss();
            frame = 0;
        }
Exemple #22
0
        public void SetButton(OnClickItem item)
        {
            menu.SetActiveContextButtons(false, false);

            switch (item.item)
            {
            case MenuItem.Resume: { transitionID = MenuState.None; } break;

            case MenuItem.MainMenu: { transitionID = MenuState.Title; } break;

            case MenuItem.Audio: { transitionID = MenuState.Audio; } break;
            }

            switch (item.item)
            {
            case MenuItem.Audio: {
                menu.SetActiveDayName(false, true);
                Choom.Pause(false);
            } break;

            case MenuItem.MainMenu: {
                AppMain.HasWon          = false;
                AppMain.DisplayAnchor   = false;
                MetaState.hardcore_mode = false;

                AppMain.tutorial.SetLesson(Lesson.NONE);
                AppMain.tutorial.SetDisplay(false);
                AppMain.MatchBonus.DismissAnimations();

                Choom.StopAllEffects();
                Choom.Pause(false);

                AppMain.top_state.child_state.Dispose();
                AppMain.top_state.child_state = null;
                Game.instance = null;

                if (AppMain.IsPaused)
                {
                    Tracker.LevelQuit(MetaState.wave_number);
                }
                else
                {
                    Tracker.EndMode(MetaState.hardcore_mode, AppMain.MainMenu.DayName(MetaState.wave_number),
                                    MetaState.hardcore_mode ? MetaState.hardcore_score : DataStorage.Money);
                }

                menu.SetActiveDayName(false, true);

                AppMain.IsPaused = false;
            } break;
            }
            CancelPressed();
        }
Exemple #23
0
        void OnEnable()
        {
            Tracker.ScreenVisit(SCREEN_NAME.PAUSE);

            Choom.Pause();
            AppMain.screenShake(0, 0);

            objectives.Play(HashIDs.menu.Intro);
            objectives.UpdateText();

            menu.SetActiveDayName(false);
            menu.Fade(0.9f, 0.25f);
        }
Exemple #24
0
 public override void startDying()
 {
     if (state == State.DYING)
     {
         return;
     }
     //position += new Vector2(0, 10);
     state    = State.DYING;
     frame    = 0;
     velocity = Vector2.zero;
     Game.instance.removeBoss();
     Choom.PlayEffect(SoundAssets.BossDie1);
 }
Exemple #25
0
 public override void tick()
 {
     frame += 10;
     if (frame == 300)
     {
         Game.instance.particle_group.add(new Pickup(position, 100 * MetaState.healing_coefficient, 0));
         Choom.PlayEffect(SoundAssets.Explosion[Util.rng.Next(SoundAssets.Explosion.Length)]);
     }
     if (frame > 1000)
     {
         remove = true;
     }
 }
Exemple #26
0
        public override void tick()
        {
            frame    += 5.0f;
            position += velocity;

            if (position.x < 250)
            {
                remove = true;
                Choom.PlayEffect(SoundAssets.HitHouse[Util.rng.Next(SoundAssets.HitHouse.Length)]);
                Game.instance.enemy_bullet_group.add(new Explosion(position, Vector2.zero, 30, 0, Gun.Ammo.NONE));
                Game.instance.damageTargetPiece(PeterBoss.bullet_damage);
            }
        }
Exemple #27
0
        public void OnEffectsChanged(Slider slider)
        {
            Choom.EffectVolume = Mathf.Clamp(slider.value, 0, 1);

            if (ignoreEffect)
            {
                ignoreEffect = false; return;
            }
            if (MainMenu.ignoreFocus)
            {
                return;
            }
            Choom.PlayEffect(SoundAssets.UISelect);
        }
Exemple #28
0
 public DrDogMiniBullet(Vector2 position_, float speed_ = 0, float damage_ = 0)
 {
     Choom.PlayEffect(SoundAssets.Gatling[Util.rng.Next(SoundAssets.Gatling.Length)]);
     position = position_;
     speed    = speed_;
     damage   = damage_;
     if (speed == 0)
     {
         speed = DrDogMiniboss.bullet_speed;
     }
     if (damage == 0)
     {
         damage = DrDogMiniboss.bullet_damage;
     }
 }
Exemple #29
0
 public override void tick()
 {
     position += velocity;
     if (!explode && position.x < Puzzle.grid_left + Puzzle.piece_size * 3)
     {
         Choom.PlayEffect(SoundAssets.HitHouse[Util.rng.Next(SoundAssets.HitHouse.Length)]);
         Game.instance.damageTargetPiece(DrDogMinion2.fire_damage);
         explode  = true;
         velocity = Vector2.zero;
         frame    = 0;
     }
     frame += 15;
     if (explode && frame > 290)
     {
         remove = true;
     }
 }
Exemple #30
0
        public override void startDying()
        {
            if (state == State.DYING)
            {
                return;
            }

            Choom.PlayEffect(SoundAssets.BossDie2);
            state = State.DYING;
            Game.instance.removeBoss();
            frame = 0;
            for (int i = 0; i < orphans_eaten; i++)
            {
                held_orphans.Add(new Orphan(Vector2.zero));
            }
            releaseOrphans();
        }