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);
        }
예제 #2
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;
        }
예제 #3
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;
        }
예제 #4
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;
        }
예제 #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;
        }
            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);
            }
        public BroodLord(LevelState parentWorld, Vector2 position)
        {
            this.parentWorld = parentWorld;
            this.position    = position;
            this.dimensions  = GlobalGameConstants.TileSize * 1.5f;
            this.velocity    = Vector2.Zero;

            minions = new BroodLing[minionCount];
            for (int i = 0; i < minionCount; i++)
            {
                minions[i] = new BroodLing(parentWorld, Vector2.Zero, this);
                parentWorld.EntityList.Add(minions[i]);
            }

            broodState = BroodLordState.Idle;

            enemy_life = 25;
            enemy_type = EnemyType.Alien;

            prob_item_drop    = 0.45;
            number_drop_items = 4;

            anim           = AnimationLib.loadNewAnimationSet("broodlord");
            anim.Animation = anim.Skeleton.Data.FindAnimation("idle");
            animation_time = 0;

            deadCushySoundTimer = 0;
        }
        public BetaEndLevelFag(LevelState parent, Vector2 position)
        {
            this.parentWorld = parent;
            this.position = position;
            this.dimensions = GlobalGameConstants.TileSize;

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

            shot.active = false;

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

            drawPointer = false;
        }
예제 #11
0
        private void loadSpine2()
        {
#if XBOX
            Thread.CurrentThread.SetProcessorAffinity(5);
#endif

            AnimationLib.cacheSpineJSON();

            preloadedJSon = true;
        }
예제 #12
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;
 }
예제 #13
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");
        }
예제 #14
0
        public Gun()
        {
            if (bulletPic == null)
            {
                bulletPic = AnimationLib.getFrameAnimationSet("testBullet");
            }

            bullets = new GunBullet[bulletCount];

            fireTimer = float.MaxValue;
        }
 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;
 }
예제 #16
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");
        }
        private void renderGameStuff(SpriteBatch sb)
        {
            AnimationLib.GraphicsDevice.SetRenderTarget(textureScreen);
            AnimationLib.renderSpineEntities(camera, entityList, cameraFocus, map, particleSet, acidSpitters);
            AnimationLib.GraphicsDevice.SetRenderTarget(null);
            screenResult = (Texture2D)textureScreen;

            AnimationLib.GraphicsDevice.SetRenderTarget(halfTextureScreen);
            AnimationLib.renderSpineEntities(camera * Matrix.CreateScale(0.5f), entityList, cameraFocus, map, particleSet, acidSpitters);
            AnimationLib.GraphicsDevice.SetRenderTarget(null);
            halfSizeTexture = (Texture2D)halfTextureScreen;

            AnimationLib.GraphicsDevice.SetRenderTarget(quarterTextureScreen);
            AnimationLib.renderSpineEntities(camera * Matrix.CreateScale(0.25f), entityList, cameraFocus, map, particleSet, acidSpitters);
            AnimationLib.GraphicsDevice.SetRenderTarget(null);
            quarterSizeTexture = (Texture2D)quarterTextureScreen;

            AnimationLib.GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.Transparent, 1.0f, 0);

            Game1.BloomFilter.Parameters["halfResMap"].SetValue(halfSizeTexture);
            Game1.BloomFilter.Parameters["quarterResMap"].SetValue(quarterSizeTexture);
            Game1.BloomFilter.Parameters["Threshold"].SetValue(0.7f);
            Game1.BloomFilter.Parameters["BlurDistanceX"].SetValue(0.0005f);
            Game1.BloomFilter.Parameters["BlurDistanceY"].SetValue(0.0005f);

            sb.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null, Game1.BloomFilter, Matrix.Identity);
            sb.Draw(screenResult, new Vector2(0), Color.White);
            sb.End();

            sb.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null, null, Matrix.Identity);
            gui.render(sb);

            if (messageQueueState == PushMessageQueueState.ShowMessage)
            {
                sb.DrawString(Game1.tenbyFive24, pushMessageQueue.Peek(), new Vector2(GlobalGameConstants.GameResolutionWidth / 2, 576) - Game1.tenbyFive24.MeasureString(pushMessageQueue.Peek()) / 2, Color.White);
            }
            else if (messageQueueState == PushMessageQueueState.FadeIn)
            {
                sb.DrawString(Game1.tenbyFive24, pushMessageQueue.Peek(), new Vector2(GlobalGameConstants.GameResolutionWidth / 2, 576) - Game1.tenbyFive24.MeasureString(pushMessageQueue.Peek()) / 2 - new Vector2(0, 50 * (1 - (queueTimer / 200))), Color.Lerp(Color.Transparent, Color.White, queueTimer / 200));
            }
            else if (messageQueueState == PushMessageQueueState.FadeOut)
            {
                sb.DrawString(Game1.tenbyFive24, pushMessageQueue.Peek(), new Vector2(GlobalGameConstants.GameResolutionWidth / 2, 576) - Game1.tenbyFive24.MeasureString(pushMessageQueue.Peek()) / 2 + new Vector2(0, 50 * (queueTimer / 200)), Color.Lerp(Color.White, Color.Transparent, queueTimer / 200));
            }

#if DEBUG
            if (showStats)
            {
                sb.DrawString(Game1.tenbyFive14, "Allegiance: " + GameCampaign.PlayerAllegiance + "\nName: " + GameCampaign.PlayerName + "\nContract: " + GameCampaign.currentContract.type + "\nSeed: " + currentSeed + "\nContract Kills: " + GameCampaign.currentContract.killCount, Vector2.Zero, Color.LimeGreen);
            }
#endif
            sb.End();
        }
        public WaveMotionGun()
        {
            if (bulletAnimation == null)
            {
                bulletAnimation = AnimationLib.getFrameAnimationSet("waveMotionBullet");
            }

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

            state = WaveMotionState.Wait;
        }
예제 #19
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");
        }
예제 #20
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 RocketLauncher()
        {
            if (rocketSprite == null)
            {
                rocketSprite = AnimationLib.getFrameAnimationSet("rocketProjectile");
            }
            if (explosionAnim == null)
            {
                explosionAnim = AnimationLib.getFrameAnimationSet("rocketExplode");
            }

            rocket.active = false;

            state = RocketLauncherState.IdleWait;
        }
        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");
        }
예제 #23
0
        public GuardSquadLeader(LevelState parentWorld, float initial_x, float initial_y)
        {
            position   = new Vector2(initial_x, initial_y);
            dimensions = new Vector2(48.0f, 48.0f);
            velocity   = new Vector2(1.0f, 0f);

            component        = new MoveSearch();
            this.parentWorld = parentWorld;

            populateSquadMates();

            direction_facing = GlobalGameConstants.Direction.Right;
            state            = SquadLeaderState.Patrol;

            follow_point_1 = new Vector2((float)(CenterPoint.X + 64 * Math.Cos(-3 * Math.PI / 4)), (float)(CenterPoint.Y + 64 * Math.Sin(-3 * Math.PI / 4)));
            if (squad_mates[0] != null)
            {
                squad_mates[0].Follow_Point = follow_point_1;
            }
            if (squad_mates[1] != null)
            {
                squad_mates[1].Follow_Point = follow_point_2;
            }

            enemy_life                      = 30;
            enemy_damage                    = 5;
            disable_movement                = false;
            disable_movement_time           = 0.0f;
            enemy_found                     = false;
            change_direction_time           = 0.0f;
            range_distance                  = 400.0f;
            change_direction_time_threshold = 5000.0f;
            enemy_type                      = EnemyType.Guard;
            death        = false;
            windup_timer = 0.0f;

            prob_item_drop    = 0.4;
            number_drop_items = 4;

            walk_down                       = AnimationLib.loadNewAnimationSet("squadLeaderDown");
            walk_right                      = AnimationLib.loadNewAnimationSet("squadLeaderRight");
            walk_up                         = AnimationLib.loadNewAnimationSet("squadLeaderUp");
            current_skeleton                = walk_right;
            current_skeleton.Animation      = current_skeleton.Skeleton.Data.FindAnimation("run");
            current_skeleton.Skeleton.FlipX = false;
            animation_time                  = 0.0f;
        }
예제 #24
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 ChargerMutantEnemy(LevelState parentWorld, Vector2 position)
        {
            this.position = position;
            dimensions    = new Vector2(32f, 96.0f);
            velocity      = Vector2.Zero;

            disable_movement      = false;
            disable_movement_time = 0.0f;
            windup_timer          = 0.0f;
            knockback_magnitude   = 8.0f;
            enemy_damage          = 15;
            enemy_life            = 20;
            enemy_found           = false;
            change_direction_time = 0.0f;
            range_distance        = 300.0f;
            charge_timer          = 0.0f;
            alert_timer           = 0.0f;
            range_distance        = 600f;
            sound_timer           = 0.0f;
            play_sound            = true;

            prob_item_drop    = 0.6;
            number_drop_items = 5;

            entity_found = null;
            state        = ChargerState.search;
            enemy_type   = EnemyType.Prisoner;
            component    = new IdleSearch();

            sound_alert = false;

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

            this.parentWorld = parentWorld;

            directionAnims = new AnimationLib.SpineAnimationSet[4];
            directionAnims[(int)GlobalGameConstants.Direction.Up]   = AnimationLib.loadNewAnimationSet("chargerUp");
            directionAnims[(int)GlobalGameConstants.Direction.Down] = AnimationLib.loadNewAnimationSet("chargerDown");
            directionAnims[(int)GlobalGameConstants.Direction.Left] = AnimationLib.loadNewAnimationSet("chargerRight");
            directionAnims[(int)GlobalGameConstants.Direction.Left].Skeleton.FlipX = true;
            directionAnims[(int)GlobalGameConstants.Direction.Right] = AnimationLib.loadNewAnimationSet("chargerRight");
            for (int i = 0; i < 4; i++)
            {
                directionAnims[i].Animation = directionAnims[i].Skeleton.Data.FindAnimation("idle");
            }
        }
예제 #26
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 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;
 }
        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;
        }
        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");
        }
예제 #30
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;
                    }
                }
            }
        }