예제 #1
0
        public ReturnChaseEnemy(LevelState parentWorld, float initial_x, float initial_y)
        {
            position              = new Vector2(initial_x, initial_y);
            dimensions            = new Vector2(48.0f, 48.0f);
            original_position     = CenterPoint;
            velocity              = new Vector2(0.0f, 0.0f);
            enemy_damage          = 10;
            enemy_life            = 15;
            distance              = 0.0f;
            angle                 = 0.0f;
            angle1                = 0.0f;
            angle2                = 0.0f;
            knockback_magnitude   = 2.0f;
            disable_movement_time = 0.0f;
            return_timer          = 0.0f;

            direction_facing      = GlobalGameConstants.Direction.Right;
            change_direction_time = 0.0f;
            enemy_found           = false;
            state = EnemyState.Idle;

            component = new IdleSearch();

            this.parentWorld = parentWorld;

            walk_down                       = AnimationLib.getSkeleton("chaseDown");
            walk_right                      = AnimationLib.getSkeleton("chaseRight");
            walk_up                         = AnimationLib.getSkeleton("chaseUp");
            current_skeleton                = walk_right;
            current_skeleton.Animation      = current_skeleton.Skeleton.Data.FindAnimation("idle");
            current_skeleton.Skeleton.FlipX = false;
            chaseAnim                       = AnimationLib.getFrameAnimationSet("chasePic");
            animation_time                  = 0.0f;
        }
예제 #2
0
        public InGameGUI(LevelState parent)
        {
            this.parent = parent;

            if (prices == null)
            {
                prices = new PriceDisplay[3];
            }

            for (int i = 0; i < windowIsActive.Length; i++)
            {
                windowIsActive[i] = false;
            }

            blackFadeOverlay = 0.0f;

            keyFoundPic    = AnimationLib.getFrameAnimationSet("keyPic");
            keyNotFoundPic = AnimationLib.getFrameAnimationSet("keyEmptyPic");

            coinAnim     = AnimationLib.getFrameAnimationSet("testCoin");
            medAnim      = AnimationLib.getFrameAnimationSet("itemHealth");
            ammoAnim     = AnimationLib.getFrameAnimationSet("itemBattery");
            arrowPointer = AnimationLib.getFrameAnimationSet("compassArrow");

            mapIcon = TextureLib.getLoadedTexture("mapPda.png");

            testWin = new BoxWindow("foo", 100, 100, 200, "GamePad code overflowing with madness");

            flickerTime      = 0.0f;
            playerOutOfSight = false;
        }
        public AntiFairy(LevelState parentWorld, Vector2 position)
        {
            this.position    = position;
            this.parentWorld = parentWorld;
            this.dimensions  = GlobalGameConstants.TileSize;

            anim           = AnimationLib.getFrameAnimationSet("antiFairy");
            animation_time = 0.0f;

            enemy_type = EnemyType.Guard;
            enemy_life = 70;

            prob_item_drop    = 0.5;
            number_drop_items = 7;

            if (position.X > 0)
            {
                other   = new AntiFairy(parentWorld, new Vector2(-100, 100));
                doubled = false;
            }
            else
            {
                doubled = true;
            }

            fairyState = (AntiFairyState)(Game1.rand.Next() % 4);
        }
            public static void NewExplosiveGib(ref Particle p, Vector2 position)
            {
                p.active        = true;
                p.animation     = AnimationLib.getFrameAnimationSet(Game1.rand.Next() % 8 != 0 ? "GibSmallGeneric" : (Game1.rand.Next() % 2 == 0 ? "heartIdle" : "lungIdle"));
                p.position      = position - (p.animation.FrameDimensions * 0.7f) / 2;
                p.timeAlive     = 0;
                p.maxTimeAlive  = 200f;
                p.rotation      = (float)(Game1.rand.NextDouble() * Math.PI * 2);
                p.rotationSpeed = (float)(Game1.rand.NextDouble() * 0.01);
                p.animationTime = 0;
                p.color         = Color.White;
                float offset = (float)(Game1.rand.NextDouble() * 1.0f - 0.5f);

                p.velocity = new Vector2((float)((Game1.rand.NextDouble() - 0.5) * 1000), 1000f * (float)(Game1.rand.NextDouble() - 0.5));

                if (p.velocity.X < 0.0f)
                {
                    p.acceleration = new Vector2(500, 0);
                }
                else
                {
                    p.acceleration = new Vector2(-500, 0);
                }
                p.scale            = new Vector2(1.0f);
                p.isGib            = true;
                p.isCasing         = false;
                p.originalPosition = p.position + new Vector2(0, 360);
            }
예제 #5
0
        public AlienChaser(LevelState parentWorld, Vector2 position)
        {
            this.parentWorld = parentWorld;
            this.position    = position;
            this.dimensions  = GlobalGameConstants.TileSize;

            enemy_type  = EnemyType.Alien;
            enemy_life  = 15;
            chaserState = SlowChaserState.Idle;

            direction_facing = GlobalGameConstants.Direction.Down;

            animation_time = 0.0f;

            konamiAlert = AnimationLib.getFrameAnimationSet("konamiPic");

            number_drop_items = 4;
            prob_item_drop    = 0.3f;

            directionAnims = new AnimationLib.SpineAnimationSet[4];
            directionAnims[(int)GlobalGameConstants.Direction.Up]   = AnimationLib.loadNewAnimationSet("alienChaserUp");
            directionAnims[(int)GlobalGameConstants.Direction.Down] = AnimationLib.loadNewAnimationSet("alienChaserDown");
            directionAnims[(int)GlobalGameConstants.Direction.Left] = AnimationLib.loadNewAnimationSet("alienChaserRight");
            directionAnims[(int)GlobalGameConstants.Direction.Left].Skeleton.FlipX = true;
            directionAnims[(int)GlobalGameConstants.Direction.Right] = AnimationLib.loadNewAnimationSet("alienChaserRight");
            for (int i = 0; i < 4; i++)
            {
                directionAnims[i].Animation = directionAnims[i].Skeleton.Data.FindAnimation("run");
            }

            aggressionTime = 0.0f;
        }
예제 #6
0
        public TestEnemy(LevelState parentWorld, Vector2 position)
        {
            this.position = position;

            dimensions = new Vector2(48f, 48f);

            state = EnemyState.Moving;

            direction_facing = GlobalGameConstants.Direction.Right;

            velocity = new Vector2(0.0f, 0.0f);

            change_direction_time       = 0.0f;
            change_direction            = 0;
            changeDirectionIdleDuration = 300f;

            this.parentWorld = parentWorld;

            enemy_life          = 10;
            enemy_damage        = 1;
            damage_player_time  = 0.0f;
            knockback_magnitude = 1.0f;

            walk_down                       = AnimationLib.loadNewAnimationSet("zippyDown");
            walk_right                      = AnimationLib.loadNewAnimationSet("zippyRight");
            walk_up                         = AnimationLib.loadNewAnimationSet("zippyUp");
            current_skeleton                = walk_right;
            current_skeleton.Animation      = current_skeleton.Skeleton.Data.FindAnimation("run");
            current_skeleton.Skeleton.FlipX = false;
            enemyAnim                       = AnimationLib.getFrameAnimationSet("enemyPic");
            animation_time                  = 0.0f;
        }
        public BetaEndLevelFag(LevelState parent, Vector2 position)
        {
            this.parentWorld = parent;
            this.position = position;
            this.dimensions = GlobalGameConstants.TileSize;

            anims = AnimationLib.getFrameAnimationSet("flagPic");
        }
예제 #8
0
        public WandOfGyges()
        {
            wandPic = AnimationLib.getFrameAnimationSet("wandProjectile");

            shot.active = false;

            delayTimer = 0;
        }
        public Compass()
        {
            if (img == null)
            {
                img  = AnimationLib.getFrameAnimationSet("compassArrow");
                img2 = AnimationLib.getFrameAnimationSet("compassOverlay");
            }

            drawPointer = false;
        }
예제 #10
0
 public Bomb()
 {
     hitbox              = hitbox_placed;
     time_explosion      = 0.0f;
     bomb_state          = Bomb_State.reset;
     bomb_damage         = 5;
     bombAnim            = AnimationLib.getFrameAnimationSet("bombArmed");
     explosionAnim       = AnimationLib.getFrameAnimationSet("rocketExplode");
     knockback_magnitude = 5.0f;
 }
예제 #11
0
        public Gun()
        {
            if (bulletPic == null)
            {
                bulletPic = AnimationLib.getFrameAnimationSet("testBullet");
            }

            bullets = new GunBullet[bulletCount];

            fireTimer = float.MaxValue;
        }
예제 #12
0
        public ShotGun()
        {
            inactive_pellets = 0;
            pellet_count     = 0;
            shotgun_active   = false;

            damage_delay_flag  = false;
            damage_delay_timer = 0.0f;

            bulletAnim = AnimationLib.getFrameAnimationSet("testBullet");
        }
 public BushidoBlade(Vector2 initial_position)
 {
     position            = initial_position;
     hitbox              = new Vector2(48.0f, 48.0f);
     sword_damage        = 999999999;
     item_state_time     = 0.0f;
     player_health       = GameCampaign.Player_Health;
     animation_time      = 0.0f;
     bushidoAnim         = AnimationLib.getFrameAnimationSet("bombExplosion");
     knockback_magnitude = 1.0f;
     glowTime            = 0;
 }
예제 #14
0
        public Sword()
        {
            hitbox.X            = 48.0f;
            hitbox.Y            = 48.0f;
            item_state_time     = 0.0f;
            sword_damage        = 5;
            knockback_magnitude = 1.0f;

            sword_state = Sword_State.preslash;

            swordAnim = AnimationLib.getFrameAnimationSet("swordPic");
        }
        public WaveMotionGun()
        {
            if (bulletAnimation == null)
            {
                bulletAnimation = AnimationLib.getFrameAnimationSet("waveMotionBullet");
            }

            bullet1.active = false;
            bullet2.active = false;
            bullet3.active = false;

            state = WaveMotionState.Wait;
        }
예제 #16
0
        public GuardMech(LevelState parentWorld, float initial_x, float initial_y)
        {
            position       = new Vector2(initial_x, initial_y);
            melee_position = Vector2.Zero;
            dimensions     = new Vector2(96, 120);
            velocity       = new Vector2(0.8f, 0.0f);
            flame_position = Vector2.Zero;

            windup_timer = 0.0f;
            angle        = 0.0f;
            turret_angle = angle;

            enemy_life                      = 75;
            disable_movement                = false;
            disable_movement_time           = 0.0f;
            enemy_found                     = false;
            change_direction_time           = 0.0f;
            this.parentWorld                = parentWorld;
            enemy_type                      = EnemyType.Guard;
            change_direction_time_threshold = 3000.0f;
            direction_facing                = GlobalGameConstants.Direction.Right;

            prob_item_drop    = 0.6;
            number_drop_items = 5;

            component                = new MoveSearch();
            mech_state               = MechState.Moving;
            enemy_type               = EnemyType.Guard;
            velocity_speed           = 3.0f;
            entity_found             = null;
            death                    = false;
            tank_hull_animation_time = 0.0f;
            explode_timer            = 0.0f;
            rocket_angle             = 0.0f;

            grenade = new Grenades(Vector2.Zero, 0.0f);

            walk_down                       = AnimationLib.loadNewAnimationSet("tankTurret");
            current_skeleton                = walk_down;
            current_skeleton.Animation      = current_skeleton.Skeleton.Data.FindAnimation("idle");
            current_skeleton.Skeleton.FlipX = false;
            animation_time                  = 0.0f;
            range_distance                  = 600.0f;

            tankAnim           = AnimationLib.getFrameAnimationSet("tank");
            tankDeadAnim       = AnimationLib.getFrameAnimationSet("tankDead");
            plasmaExplode      = AnimationLib.getFrameAnimationSet("plasmaExplodeLong");
            tankTurretDeadAnim = AnimationLib.getFrameAnimationSet("tankTurretDead");
            rocketProjectile   = AnimationLib.getFrameAnimationSet("rocketProjectile");
        }
예제 #17
0
        public Key(LevelState parent, Vector2 position, LevelKeyModule.KeyColor color)
        {
            this.parentWorld = parent;
            this.position    = position;
            this.velocity    = Vector2.Zero;
            this.dimensions  = new Vector2(48f, 48f);

            this.color = color;

            isKnockedBack   = false;
            knockedBackTime = 0.0f;

            keyGraphic = AnimationLib.getFrameAnimationSet("keyPic");
        }
        public BroodLing(LevelState parentWorld, Vector2 position, BroodLord lord)
        {
            minionState      = BroodLingState.Dead;
            this.parentWorld = parentWorld;
            this.dimensions  = GlobalGameConstants.TileSize * 0.6f;
            this.lord        = lord;

            enemy_life = 0;
            enemy_type = EnemyType.Alien;

            animation_time = 0;

            anim    = AnimationLib.loadNewAnimationSet("broodling");
            eggAnim = AnimationLib.getFrameAnimationSet("broodEgg");
        }
        public RocketLauncher()
        {
            if (rocketSprite == null)
            {
                rocketSprite = AnimationLib.getFrameAnimationSet("rocketProjectile");
            }
            if (explosionAnim == null)
            {
                explosionAnim = AnimationLib.getFrameAnimationSet("rocketExplode");
            }

            rocket.active = false;

            state = RocketLauncherState.IdleWait;
        }
예제 #20
0
        public MutantAcidSpitter(LevelState parentWorld, float initial_x, float initial_y)
        {
            position       = new Vector2(initial_x, initial_y);
            velocity_speed = 2.0f;
            velocity       = new Vector2(velocity_speed, 0);
            dimensions     = new Vector2(48.0f, 48.0f);

            enemy_damage                    = 4;
            enemy_life                      = 5;
            windup_timer                    = 0.0f;
            spitter_count                   = 0;
            change_direction_time           = 0.0f;
            change_direction_time_threshold = 1000.0f;
            angle          = 0.0f;
            range_distance = 500.0f;

            prob_item_drop    = 0.3;
            number_drop_items = 4;

            state            = SpitterState.Search;
            this.parentWorld = parentWorld;
            direction_facing = GlobalGameConstants.Direction.Right;
            enemy_type       = EnemyType.Alien;
            entity_found     = null;
            acid_pool        = AnimationLib.getFrameAnimationSet("acidPool");

            for (int i = 0; i < size_of_spit_array; i++)
            {
                projectile[i]        = new SpitProjectile(new Vector2(0, 0), 0);
                projectile[i].active = false;
            }

            death = false;

            directionAnims = new AnimationLib.SpineAnimationSet[4];
            directionAnims[(int)GlobalGameConstants.Direction.Up]   = AnimationLib.loadNewAnimationSet("acidSpitterUp");
            directionAnims[(int)GlobalGameConstants.Direction.Down] = AnimationLib.loadNewAnimationSet("acidSpitterDown");
            directionAnims[(int)GlobalGameConstants.Direction.Left] = AnimationLib.loadNewAnimationSet("acidSpitterRight");
            directionAnims[(int)GlobalGameConstants.Direction.Left].Skeleton.FlipX = true;
            directionAnims[(int)GlobalGameConstants.Direction.Right] = AnimationLib.loadNewAnimationSet("acidSpitterRight");

            for (int i = 0; i < 4; i++)
            {
                directionAnims[i].Animation = directionAnims[i].Skeleton.Data.FindAnimation("run");
            }
        }
 public static void NewImpactEffect(ref Particle p, Vector2 position, Color c)
 {
     p.active           = true;
     p.position         = position;
     p.timeAlive        = 0;
     p.maxTimeAlive     = 500f + (float)Game1.rand.NextDouble() * 200f;
     p.rotation         = (float)(Game1.rand.NextDouble() * Math.PI * 2);
     p.rotationSpeed    = 0;
     p.animationTime    = 0;
     p.animation        = AnimationLib.getFrameAnimationSet("bulletImpact");
     p.color            = c;
     p.velocity         = Vector2.Zero;
     p.acceleration     = Vector2.Zero;
     p.scale            = new Vector2(1);
     p.isGib            = false;
     p.isCasing         = false;
     p.originalPosition = p.position;
 }
예제 #22
0
        public Coin(LevelState parentWorld, Vector2 position)
        {
            this.position    = position;
            this.parentWorld = parentWorld;

            dimensions = new Vector2(24, 24);

            dropItem = DropItemType.CoinDrop;

            state = DropState.Inactive;

            coinAnim      = AnimationLib.getFrameAnimationSet("testCoin");
            medAnim       = AnimationLib.getFrameAnimationSet("itemHealth");
            ammoAnim      = AnimationLib.getFrameAnimationSet("itemBattery");
            animationTime = 0.0f;

            isKnockedBack = false;
        }
        public BallMutant(LevelState parentWorld, float initial_x, float initial_y)
        {
            position        = new Vector2(initial_x, initial_y);
            dimensions      = new Vector2(48f, 48f);
            velocity        = Vector2.Zero;
            ball_coordinate = Vector2.Zero;

            state            = mutantBallState.Search;
            component        = new IdleSearch();
            direction_facing = GlobalGameConstants.Direction.Right;

            radius = 0.0f;
            angle  = 0.0f;
            change_direction_time = 0.0f;
            agressive_timer       = 0.0f;
            distance            = 0.0f;
            alert_timer         = 0.0f;
            knockback_magnitude = 5.0f;
            range_distance      = 250.0f;

            this.parentWorld = parentWorld;

            death = false;

            enemy_damage = 5;
            enemy_life   = 5;
            enemy_type   = EnemyType.Alien;

            prob_item_drop    = 0.4;
            number_drop_items = 4;

            walk_down                       = AnimationLib.loadNewAnimationSet("ballMutantUp");
            walk_right                      = AnimationLib.loadNewAnimationSet("ballMutantRight");
            walk_up                         = AnimationLib.loadNewAnimationSet("ballMutantUp");
            current_skeleton                = walk_right;
            current_skeleton.Animation      = current_skeleton.Skeleton.Data.FindAnimation("run");
            current_skeleton.Skeleton.FlipX = false;
            //chaseAnim = AnimationLib.getFrameAnimationSet("chasePic");
            animation_time = 0.0f;

            entity_found = null;

            chain_ball = AnimationLib.getFrameAnimationSet("snakeB");
        }
        public MolotovEnemy(LevelState parentWorld, Vector2 position)
        {
            this.parentWorld = parentWorld;
            this.position    = position;
            this.dimensions  = GlobalGameConstants.TileSize;

            entity_found = null;

            molotovState     = MolotovState.MoveWait;
            moveWaitStepping = false;
            moveWaitTimer    = 0.0f;

            flame        = new MolotovFlame(position);
            flame.active = false;

            this.enemy_type = EnemyType.Prisoner;

            direction_facing = (GlobalGameConstants.Direction)(Game1.rand.Next() % 4);

            range_distance = 400.0f;

            health = 15;

            prob_item_drop    = 0.3;
            number_drop_items = 3;

            templateAnim   = AnimationLib.getFrameAnimationSet("molotov");
            flameAnim      = AnimationLib.getFrameAnimationSet("molotovFlame");
            animation_time = 0.0f;

            directionAnims = new AnimationLib.SpineAnimationSet[4];
            directionAnims[(int)GlobalGameConstants.Direction.Up]   = AnimationLib.loadNewAnimationSet("molotovUp");
            directionAnims[(int)GlobalGameConstants.Direction.Down] = AnimationLib.loadNewAnimationSet("molotovDown");
            directionAnims[(int)GlobalGameConstants.Direction.Left] = AnimationLib.loadNewAnimationSet("molotovRight");
            directionAnims[(int)GlobalGameConstants.Direction.Left].Skeleton.FlipX = true;
            directionAnims[(int)GlobalGameConstants.Direction.Right] = AnimationLib.loadNewAnimationSet("molotovRight");

            for (int i = 0; i < 4; i++)
            {
                directionAnims[i].Animation = directionAnims[i].Skeleton.Data.FindAnimation("run");
            }

            enemy_type = EnemyType.Prisoner;
        }
예제 #25
0
        public KeyDoor(LevelState parent, Vector2 position, LevelKeyModule.KeyColor color, DoorDirection directions)
        {
            this.parentWorld = parent;
            this.position    = position;
            this.velocity    = Vector2.Zero;
            dimensions       = GlobalGameConstants.TileSize;

            this.color      = color;
            this.directions = directions;

            keyGraphic = AnimationLib.getFrameAnimationSet("keyPic");

            // reposition and resize the door to fill the current wall
            {
                this.position.X -= this.position.X % GlobalGameConstants.TileSize.X;
                this.position.Y -= this.position.Y % GlobalGameConstants.TileSize.Y;

                if (directions == DoorDirection.EastWest)
                {
                    while (parentWorld.Map.hitTestWall(this.position - new Vector2(1.0f, 0.0f)) != true)
                    {
                        this.position.X -= GlobalGameConstants.TileSize.X;
                    }

                    while (parentWorld.Map.hitTestWall(this.position + new Vector2(this.dimensions.X, 0.0f)) != true)
                    {
                        this.dimensions.X += GlobalGameConstants.TileSize.X;
                    }
                }
                else if (directions == DoorDirection.NorthSouth)
                {
                    while (parentWorld.Map.hitTestWall(this.position - new Vector2(0.0f, 1.0f)) != true)
                    {
                        this.position.Y -= GlobalGameConstants.TileSize.Y;
                    }

                    while (parentWorld.Map.hitTestWall(this.position + new Vector2(0.0f, this.dimensions.Y)) != true)
                    {
                        this.dimensions.Y += GlobalGameConstants.TileSize.Y;
                    }
                }
            }
        }
        public SnakeWorm(LevelState parentWorld, Vector2 position)
        {
            this.parentWorld = parentWorld;
            this.position    = position;
            this.dimensions  = new Vector2(24);

            snakeState = SnakeWormState.Moving;

            velocity = Vector2.Zero;

            direction      = (float)(Game1.rand.NextDouble() * Math.PI * 2);
            dirModifier    = 1.0f;
            switchTimer    = 0.0f;
            switchDuration = averageSwitchDuration;

            enemy_life = 16;
            enemy_type = EnemyType.Alien;

            prob_item_drop    = 0.3;
            number_drop_items = 4;

            tailData       = new TailPosition[tailPiecesCount, positionsCount];
            tailMostRecent = 0;
            for (int j = 0; j < tailPiecesCount; j++)
            {
                for (int i = 0; i < positionsCount; i++)
                {
                    tailData[j, i] = new TailPosition(position, direction);
                }
            }

            secondaryHitBoxes = new SecondaryHitBox[secondaryHitBoxCount];
            for (int i = 0; i < secondaryHitBoxCount; i++)
            {
                secondaryHitBoxes[i] = new SecondaryHitBox(position, new Vector2(16));
            }

            testAnim       = AnimationLib.getFrameAnimationSet("snakeA");
            tailAnimA      = AnimationLib.getFrameAnimationSet("snakeB");
            tailAnimB      = AnimationLib.getFrameAnimationSet("snakeC");
            animation_time = 0;
        }
        public PatrolGuard(LevelState parentWorld, Vector2 position)
        {
            this.parentWorld = parentWorld;
            this.position    = position;
            this.dimensions  = GlobalGameConstants.TileSize;

            bulletAnim = AnimationLib.getFrameAnimationSet("testBullet");

            deadCushySoundTimer = 0;

            bullets = new GunBullet[bulletSupply];
            for (int i = 0; i < bulletSupply; i++)
            {
                bullets[i].active = false;
            }

            direction_facing = GlobalGameConstants.Direction.Down;
            guardState       = PatrolGuardState.MoveWait;
            enemy_type       = EnemyType.Guard;

            prob_item_drop    = 0.3;
            number_drop_items = 3;

            directionAnims = new AnimationLib.SpineAnimationSet[4];
            directionAnims[(int)GlobalGameConstants.Direction.Up]   = AnimationLib.loadNewAnimationSet("patrolUp");
            directionAnims[(int)GlobalGameConstants.Direction.Down] = AnimationLib.loadNewAnimationSet("patrolDown");
            directionAnims[(int)GlobalGameConstants.Direction.Left] = AnimationLib.loadNewAnimationSet("patrolRight");
            directionAnims[(int)GlobalGameConstants.Direction.Left].Skeleton.FlipX = true;
            directionAnims[(int)GlobalGameConstants.Direction.Right] = AnimationLib.loadNewAnimationSet("patrolRight");
            for (int i = 0; i < 4; i++)
            {
                directionAnims[i].Animation = directionAnims[i].Skeleton.Data.FindAnimation("run");
            }

            health = 15;

            //calculate the center of the chunk you're placed in
            chunkCenter.X = (((int)((position.X / (GlobalGameConstants.TileSize.X)) / GlobalGameConstants.TilesPerRoomWide)) * GlobalGameConstants.TilesPerRoomWide * GlobalGameConstants.TileSize.X) + ((GlobalGameConstants.TilesPerRoomWide / 2) * GlobalGameConstants.TileSize.X);
            chunkCenter.Y = (((int)((position.Y / (GlobalGameConstants.TileSize.Y)) / GlobalGameConstants.TilesPerRoomHigh)) * GlobalGameConstants.TilesPerRoomHigh * GlobalGameConstants.TileSize.Y) + ((GlobalGameConstants.TilesPerRoomHigh / 2) * GlobalGameConstants.TileSize.Y);

            retreatTimer = 0;
        }
            public static void NewFlame(ref Particle p, Vector2 position, Color c, float direction)
            {
                p.active        = true;
                p.animation     = AnimationLib.getFrameAnimationSet(Game1.rand.Next() % 3 == 0 ? "flame1" : (Game1.rand.Next() % 2 == 0 ? "flame2" : "flame3"));
                p.position      = position - p.animation.FrameDimensions / 2;
                p.timeAlive     = 0;
                p.maxTimeAlive  = 500 + (float)(Game1.rand.NextDouble() * 200);
                p.rotation      = direction;
                p.rotationSpeed = (float)(Game1.rand.NextDouble() * 0.01);
                p.animationTime = 0;
                p.color         = c;
                float offset = (float)(Game1.rand.NextDouble() * 1.0f - 0.5f);

                p.velocity         = new Vector2((float)Math.Cos(direction + offset), (float)Math.Sin(direction + offset)) * flameInitalSpeed;
                p.acceleration     = Vector2.Zero;
                p.scale            = new Vector2(0.7f);
                p.isGib            = false;
                p.isCasing         = false;
                p.originalPosition = p.position;
            }
            public static void NewGib(ref Particle p, Vector2 position)
            {
                p.active        = true;
                p.animation     = AnimationLib.getFrameAnimationSet(Game1.rand.Next() % 8 != 0 ? "GibSmallGeneric" : (Game1.rand.Next() % 2 == 0 ? "heartIdle" : "lungIdle"));
                p.position      = position - (p.animation.FrameDimensions * 0.7f) / 2;
                p.timeAlive     = 0;
                p.maxTimeAlive  = 3000f;
                p.rotation      = (float)(Game1.rand.NextDouble() * Math.PI * 2);
                p.rotationSpeed = (float)(Game1.rand.NextDouble() * 0.01);
                p.animationTime = 0;
                p.color         = Color.White;
                float offset = (float)(Game1.rand.NextDouble() * 1.0f - 0.5f);

                p.velocity         = new Vector2((float)(Game1.rand.NextDouble() * 150 - 75), -280f + (float)(Game1.rand.NextDouble() * 50));
                p.acceleration     = new Vector2(0, 500);
                p.scale            = new Vector2(0.7f);
                p.isGib            = true;
                p.isCasing         = false;
                p.originalPosition = p.position;
            }
            public static void newRocketCasing(ref Particle p, Vector2 position)
            {
                p.active        = true;
                p.animation     = AnimationLib.getFrameAnimationSet("casing");
                p.position      = position - (p.animation.FrameDimensions * 0.7f) / 2;
                p.timeAlive     = 0;
                p.maxTimeAlive  = 3000f;
                p.rotation      = (float)(Game1.rand.NextDouble() * Math.PI * 2);
                p.rotationSpeed = (float)(Game1.rand.NextDouble() * 0.01);
                p.animationTime = 0;
                p.color         = Color.White;
                float offset = (float)(Game1.rand.NextDouble() * 1.0f - 0.5f);

                p.velocity         = new Vector2((float)(Game1.rand.NextDouble() * 75 - 75), -280f + (float)(Game1.rand.NextDouble() * 50));
                p.acceleration     = new Vector2(0, 900);
                p.scale            = new Vector2(10.0f);
                p.isGib            = false;
                p.isCasing         = true;
                p.originalPosition = p.position + new Vector2(0, 32f);
            }