Ejemplo n.º 1
0
 public Knight(AnimatedSprite sprite, Vector2 position, int hitPoints, int manaPoints,
     int expLevel, int strength, int defense, Vector2 speed, List<Vector2> patrolTargets, MainCharacter mainCharacter,
     GameplayScreen gameplayScreen)
     : base(sprite, position, hitPoints, manaPoints, expLevel, strength, defense, speed,
     patrolTargets, mainCharacter, gameplayScreen)
 {
 }
Ejemplo n.º 2
0
        public override void HandleInput(InputState input)
        {
            if (isLoading == true)
            {
                base.HandleInput(input);
                return;
            }

            foreach (var gesture in input.Gestures)
            {
                if (gesture.GestureType == GestureType.Tap)
                {
                    // Create a new instance of the gameplay screen
                    gameplayScreen = new GameplayScreen();
                    gameplayScreen.ScreenManager = ScreenManager;

                    // Start loading the resources in additional thread
                    thread = new System.Threading.Thread(
                        new System.Threading.ThreadStart(gameplayScreen.LoadAssets));
                    isLoading = true;
                    thread.Start();
                }
            }

            base.HandleInput(input);
        }
Ejemplo n.º 3
0
 public Gun(GameplayScreen gameplayScreen, GameCharacter owner)
     : base(gameplayScreen, owner)
 {
     _bullet = new Bullet(ImageManager.BulletTexture);
     coolDownTime = 0.8;
     coolDownElapsed = 0;
 }
Ejemplo n.º 4
0
 public Bow(GameplayScreen gameplayScreen, GameCharacter owner)
     : base(gameplayScreen, owner)
 {
     _arrow = new Arrow(ImageManager.ArrowTexture);
     coolDownTime = 1.5;
     coolDownElapsed = 0;
 }
Ejemplo n.º 5
0
 public ScreenManager(ArmaliaGame game)
     : base(game)
 {
     spriteBatch = game.SpriteBatch;
     splashScreen = new SplashScreen(game, this, SPLASH_FILENAME);
     gameplayScreen = new GameplayScreen(game, this);
     CurrentState = GameState.Splash;
 }
Ejemplo n.º 6
0
 public SpaceWorld(Game game, SpriteSheet spriteSheet, GameplayScreen screen, bool tutorial)
     : base(game, new Vector2(0, 0))
 {
     Tutorial = tutorial;
     GameScreen = screen;
     this._spriteSheet = spriteSheet;
     this._Font = new ImageFont();
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Load the screen resources
        /// </summary>
        public override void LoadContent()
        {
            background = Load<Texture2D>(@"Images\instructions");
            font = Load<SpriteFont>(@"Fonts\MenuFont");

            // Create a new instance of the gameplay screen
            gameplayScreen = new GameplayScreen(theme);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Constructor 2
 /// </summary>
 /// <param name="sprite">The animation sprite of the character</param>
 /// <param name="position">The position of the character on the map</param>
 /// <param name="numCoins">The number of coins the character starts off </param>
 /// <param name="speed">The movement speed of the character.</param>
 /// <param name="gameplayScreen">The gameplay screen for the game.</param>
 public Character(AnimatedSprite sprite, Vector2 position, int numCoins, Vector2 speed, GameplayScreen gameplayScreen)
 {
     this.CharacterSprite = sprite;
     this.Position = position;
     this.numCoins = numCoins;
     this.speed = speed;
     this.gameplayScreen = gameplayScreen;
 }
Ejemplo n.º 9
0
 public Collectable(Game game, GameplayScreen host)
     : base(game, host,"star")
 {
     CollectedYet = false;
     scale = 5;
     m_localRotation =Quaternion.CreateFromAxisAngle(new Vector3(0,1,0),(float)Math.PI/2);
     //modelName = "Asteroid";
 }
Ejemplo n.º 10
0
        public MainMenuScreen(GameplayScreen gameplayScreen)
        {
            IsPopup = true;
            gameStarted = false;

            this.gameplayScreen = gameplayScreen;

            if(!settings.Contains("IsSoundOn"))
            {
                settings.Add("IsSoundOn", IsSoundOn);
                settings.Save();
            }
        }
Ejemplo n.º 11
0
 public void Load(GameplayScreen currentGameplayScreen, ContentManager content)
 {
     LevelTime.Initialize();
     totalTime = 0;
     gameplayScreen = currentGameplayScreen;
     LoadAssets(content);
     Player.resources = startingResources;
     Player.score = 0;
     if (_nathaniel != null && _hermes != null)
     {
         PlayerManager.Initialize(gameplayScreen.ScreenManager.Game, gameplayScreen, _nathaniel, _hermes);
     }
 }
Ejemplo n.º 12
0
 public Level(Texture2D levelBackground, int number, Dictionary<string, Texture2D> enemies, Dictionary<string, Texture2D> bullets, GameplayScreen screen)
 {
     Screen = screen;
     AvailableBullets = bullets;
     AvailableEnemies = enemies;
     Number = number;
     Texture = levelBackground;
     Size = new Vector2(levelBackground.Width, levelBackground.Height);
     Velocity.Y = 0.4f;
     TOBamGame.soundBank.PlayCue("required_ttc");
     TOBamGame.soundBank.PlayCue("flue");
     //Position.Y = 0;
 }
Ejemplo n.º 13
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public GameplayScreen(bool isNetworkGame)
        {
            TransitionOnTime = TimeSpan.FromSeconds(1.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);

            pauseAction = new InputAction(
                new Buttons[] { Buttons.Start, Buttons.Back },
                new Keys[] { Keys.Escape },
                true);

            main = this;

            _isNetwork = isNetworkGame;
        }
Ejemplo n.º 14
0
        public CombatableCharacter(AnimatedSprite sprite, Vector2 position, int hitPoints, int manaPoints,
            int expLevel, int strength, int defense, Vector2 speed, GameplayScreen gameplayScreen)
            : base(sprite, position, speed, gameplayScreen)
        {
            this.HitPoints = hitPoints;
            this.ManaPoints = manaPoints;
            this.ExpLevel = expLevel;
            this.Strength = strength;
            this.Defense = defense;
            IsInPain = false;

            TextureData =
                new Color[CharacterSprite.Texture.Width * CharacterSprite.Texture.Height];
            CharacterSprite.Texture.GetData(TextureData);
        }
Ejemplo n.º 15
0
        public EnemyCharacter(AnimatedSprite sprite, Vector2 position, int hitPoints, int manaPoints,
            int expLevel, int strength, int defense, Vector2 speed,
            List<Vector2> patrolTargets, MainCharacter mainCharacter, GameplayScreen gameplayScreen)
            : base(sprite, position, hitPoints, manaPoints, expLevel, strength, defense, speed, gameplayScreen)
        {
            this.patrolTargets = patrolTargets;
            this.PlayerCharacter = mainCharacter;

            DirectionStuckIn = MoveDirection.None;
            UnstickAttempts = 0;
            randomMover = new Random();

            currentState = EnemyState.Patrol;
            currentTarget = patrolTargets[0];
        }
        public void AnimateSwitch(Sprite sprite, GameTime gameTime, GameplayScreen.LevelState _levelState)
        {
            sprite.Timer += (float)gameTime.ElapsedGameTime.TotalSeconds * sprite.AnimationFPS;

            //process frame change if enough time has elapsed
            if (sprite.Timer >= 1.0f)
            {
                if (sprite.CurrentFrame == 0)
                {
                    if (LevelDataManager.rand.Next(0, 100) < 8)
                    {
                        sprite.CurrentFrame = 1;
                        sprite.Timer -= 1.0f;
                        return;
                    }
                    else sprite.Timer -= 1.0f;
                }

                if (sprite.CurrentFrame == 1)
                {
                    sprite.CurrentFrame = 0;
                    sprite.Timer -= 1.0f;
                    return;
                }

                if (sprite.CurrentFrame == 2)
                {
                    //ensures once switch hit once per second (12 frames)
                    if (sprite.Timer >= 12.0f)
                    {
                        sprite.CurrentFrame = 0;
                        sprite.Timer = 0f;
                    }
                    return;
                }

            }
            return;
        }
Ejemplo n.º 17
0
        public LevelManager(ArmaliaGame game, MainCharacter playerCharacter, GameplayScreen gameplayScreen)
        {
            this.game = game;
            this.gameplayScreen = gameplayScreen;
            this.mapMaker = new MapMaker(game, this);
            this.playerCharacter = playerCharacter;

            mapFiles = new Dictionary<string, string>();
            songFiles = new Dictionary<string, string>();
            gameLevels = new Dictionary<string, GameLevel>();

            mapFiles.Add("Building1", @"Maps\Building1\Building1");
            mapFiles.Add("Village0", @"Maps\Village0\Village0");
            mapFiles.Add("Forest1", @"Maps\Forest1\Forest1");
            mapFiles.Add("Forest2", @"Maps\Forest2\Forest2");
            mapFiles.Add("Forest3", @"Maps\Forest3\Forest3");
            mapFiles.Add("Cave0", @"Maps\Cave0\Cave0");
            mapFiles.Add("Building2", @"Maps\Building2\Building2");
            mapFiles.Add("Building3", @"Maps\Building3\Building3");
            songFiles.Add("Village0", @"Music\Home");

            LoadLevels();
        }
Ejemplo n.º 18
0
 public Player(MainCharacter character, GameplayScreen gameplayScreen)
 {
     PlayerCharacter = character;
     this.gameplayScreen = gameplayScreen;
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Creates a new instance of the launched game component.
 /// </summary>
 /// <param name="game">Associated game object.</param>
 /// <param name="gameScreen">Game screen where the component will be presented.</param>
 /// <param name="texture">Texture asset which represents the component.</param>
 public LaunchedComponent(Game game, GameplayScreen gameScreen, Texture2D texture)
     : base(game, gameScreen, texture)
 {
 }
Ejemplo n.º 20
0
 protected override void OnUpdate(GameplayScreen gameplayScreen)
 {
 }
Ejemplo n.º 21
0
 /// <inheritdoc />
 /// <summary>
 /// </summary>
 /// <param name="screen"></param>
 /// <param name="map"></param>
 public GameplayRulesetKeys(GameplayScreen screen, Qua map) : base(screen, map) => InitializeTimingLines();
Ejemplo n.º 22
0
        public PDVehicle(Game game, GameplayScreen screen)
            : base(game)
        {
            m_screen = screen;

            m_maxHealth = m_health = 100.0f;

            Depth = 0.1f;

            m_leanValue     = 0.0f;
            m_leanIncrease  = 1.0f;
            m_leanNormalize = 0.90f;

            m_animTable = new string[9];

            m_animTable[0] = PDVehicle.ANIM_IDLE_LEFT4;
            m_animTable[1] = PDVehicle.ANIM_IDLE_LEFT3;
            m_animTable[2] = PDVehicle.ANIM_IDLE_LEFT2;
            m_animTable[3] = PDVehicle.ANIM_IDLE_LEFT1;
            m_animTable[4] = PDVehicle.ANIM_IDLE_CENTER;
            m_animTable[5] = PDVehicle.ANIM_IDLE_RIGHT1;
            m_animTable[6] = PDVehicle.ANIM_IDLE_RIGHT2;
            m_animTable[7] = PDVehicle.ANIM_IDLE_RIGHT3;
            m_animTable[8] = PDVehicle.ANIM_IDLE_RIGHT4;



            RotationRate = 0.5f;

            if (m_randomTable == null)
            {
                m_randomTable = new float[100];
                for (int i = 0; i < 100; i++)
                {
                    m_randomTable[i] = (float)Game1.Rand.NextDouble() * 1 + 0.0f;
                }
            }

            m_obb = new OBB(Rotation, Position, new Vector2(60, 20));

            Texture2D tex = GameplayScreen.m_tShadow;

            m_shadow = new Animation(game);
            m_shadow.Initialize(ref tex);

            AnimationSet set = new AnimationSet("idle", true, 1.0f, 0);

            set.AddFrame(new Rectangle(0, 0, 160, 96));
            m_shadow.AddSet(set);
            m_shadow.SetActiveSet("idle", 0);
            m_shadow.Origin = new Vector2(80, 48);
            m_shadow.Depth  = 0.1f;
            m_shadow.Scale  = new Vector2(0.8f, 0.8f);



            m_hpBarBG = new Animation(game);
            m_hpBarBG.Initialize(ref GameplayScreen.m_tHPBarBG);

            set = new AnimationSet("idle", true, 1.0f, 0);
            set.AddFrame(new Rectangle(0, 0, 140, 30));
            m_hpBarBG.AddSet(set);
            m_hpBarBG.SetActiveSet("idle", 0);
            m_hpBarBG.Depth  = 0.9f;
            m_hpBarBG.Origin = new Vector2(50, 80);

            m_hpBar = new Animation(game);
            m_hpBar.Initialize(ref GameplayScreen.m_tHPBar);

            set = new AnimationSet("idle", true, 1.0f, 0);
            set.AddFrame(new Rectangle(0, 0, 140, 30));
            m_hpBar.AddSet(set);
            m_hpBar.SetActiveSet("idle", 0);
            m_hpBar.Depth  = 0.95f;
            m_hpBar.Origin = new Vector2(50, 80);

            Gold    = Game1.Rand.Next(0, 500);
            Silk    = Game1.Rand.Next(0, 200);
            Rum     = Game1.Rand.Next(0, 200);
            Tools   = Game1.Rand.Next(0, 200);
            Rope    = Game1.Rand.Next(0, 200);
            Leather = Game1.Rand.Next(0, 200);
            Iron    = Game1.Rand.Next(0, 200);
            Coal    = Game1.Rand.Next(0, 200);
            Spices  = Game1.Rand.Next(0, 200);
        }
Ejemplo n.º 23
0
 /// <summary>
 /// Creates a new instance of the throwing star component.
 /// </summary>
 /// <param name="game">Associated game object.</param>
 /// <param name="gameScreen">Game screen where the component will be presented.</param>
 /// <param name="animation">Animation object which represents the component.</param>
 public ThrowingStar(Game game, GameplayScreen gameScreen, Animation animation)
     : base(game, gameScreen, animation)
 {
     random = new Random();
 }
Ejemplo n.º 24
0
 public Tile_w2_r1_c1(GameplayScreen gameplayScreen, IWorld world)
     : base(gameplayScreen, new Vector2(150, 250), world)
 {
     _gameplayScreen = gameplayScreen;
 }
Ejemplo n.º 25
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            if (content == null)
            {
                content = new ContentManager(this.Services, "content");
            }

            /*/
             * //загрузка текстуры сетки
             * testGrid = content.Load<Texture2D>("testGrid1");
             * /*/
            //загрузка шрифтов
            fontSmall  = content.Load <SpriteFont>(@"Fonts\pixSmall");
            fontMedium = content.Load <SpriteFont>(@"Fonts\pix10");
            fontNormal = content.Load <SpriteFont>(@"Fonts\pix12");

            fonts[0] = fontSmall;
            fonts[1] = fontMedium;
            fonts[2] = fontNormal;

            //загрузка текстуры стандартного курсора
            cursorDefault = content.Load <Texture2D>(@"Cursors\cursorDefault");

            //MouseState mouseState = Mouse.GetState();
            //MouseCursor.FromTexture2D(cursorDefault, mouseState.X, mouseState.Y);
            //
            //cursorPosition = new Rectangle();
            //инициализация игрового курсора

            /*GameCursor = new Cursor(this, cursorDefault, new Rectangle(0, 0,
             *  cursorDefault.Width,
             *  cursorDefault.Height));
             * Components.Add(GameCursor);*/


            // TODO: use this.content to load your game content here


            //загрузка лого разработчика
            developerLogo = content.Load <Texture2D>(@"SplashScreens\developerLogo");
            gameLogo      = content.Load <Texture2D>(@"SplashScreens\gameLogo");

            splashScreen = developerLogo;


            // грузим уровни
            level1.LoadContent(content, @"Textures\Levels\District1\dist1_sprite1_hotelHomeFloor");
            level2.LoadContent(content, @"Textures\Levels\District1\dist1_sprite2_hotelOutsideStreet");

            //Загружаем элементы игры и создаем игровые экраны
            //spriteBatch = new SpriteBatch(GraphicsDevice);
            Services.AddService(typeof(SpriteBatch), spriteBatch);

            //загрузка контента экрана главного меню
            menuBG = content.Load <Texture2D>(@"Textures\Interface\MainMenu\MainMenuBg");
            //menuGameName = content.Load<Texture2D>("menuGameName");
            menuStartGameMain = content.Load <Texture2D>(@"Textures\Interface\MainMenu\startMain");
            menuCredits       = content.Load <Texture2D>(@"Textures\Interface\MainMenu\creditsMenuItem");
            menuExit          = content.Load <Texture2D>(@"Textures\Interface\exitMenuItem");
            menuScreen        = new MenuScreen(this, menuBG, menuStartGameMain, menuCredits,
                                               menuExit, new Rectangle(152, 110, 500, 360), new Rectangle(610, 390, 100, 100),
                                               new Rectangle(725, 520, 70, 70));
            Components.Add(menuScreen);

            //загрузка контента информационного экрана
            creditsBG     = content.Load <Texture2D>(@"Textures\Interface\MainMenu\MainMenuBg");
            creditsText   = content.Load <Texture2D>(@"Textures\Interface\MainMenu\creditsMenuItem");
            creditsScreen = new CreditsScreen(this, creditsBG, fonts,
                                              new Rectangle(0, 0, this.Window.ClientBounds.Width, this.Window.ClientBounds.Height),
                                              new Rectangle((this.Window.ClientBounds.Width - 200) / 2,
                                                            (this.Window.ClientBounds.Height - 200) / 2,
                                                            100, 100));
            Components.Add(creditsScreen);

            //загрузка контента игрового экрана
            player.LoadContent(content, @"Textures\Skins\Player\playerStatic");
            gameplayInterfaceBG = content.Load <Texture2D>(@"Textures\Interface\GameplayInterface\interfaceBG");
            newGameScreen       = new GameplayScreen(this, level2, player, ref gameplayInterfaceBG,
                                                     new Rectangle(0, 0, 800, 600), Vector2.Zero);
            Components.Add(newGameScreen);

            //Отображаем меню, остальные элементы скрыты
            menuScreen.Show();
        }
Ejemplo n.º 26
0
 public MainCharacter(GameplayScreen gameplayScreen, Vector2 pkaardiAsukoht)
     : base(gameplayScreen, pkaardiAsukoht, "downmovesheet_2", 3, 40)
 {
 }
Ejemplo n.º 27
0
        public void GoToMainMenu()
        {
            GameplayScreen gameplayScreen = new GameplayScreen();

            LoadingScreen.Load(ScreenManager, false, null, gameplayScreen,
                                                            new MainMenuScreen(gameplayScreen));
        }
Ejemplo n.º 28
0
        //Replay button event handler
        public void buttonReplay_Selected(object sender, EventArgs e)
        {
            //Create a new gameplay screen
            GameplayScreen gameplayScreen = new GameplayScreen();
            gameplayScreen.GameStarted = true;

            //Load the gameplay screen by exiting all existing screens and displaying gameplay screen
            LoadingScreen.Load(ScreenManager, false, null, gameplayScreen);
        }
Ejemplo n.º 29
0
        public List<EnemyCharacter> GetEnemies(String mapFilename, MainCharacter mainCharacter, GameplayScreen gameplayScreen)
        {
            var mapXML = XElement.Load(game.Content.RootDirectory + "\\" + mapFilename + ".tmx");
            var objectElements = mapXML.Elements("objectgroup").Elements().ToList();

            List<EnemyCharacter> enemies = new List<EnemyCharacter>();
            foreach (var obj in objectElements)
            {
                string type = null;
                if (obj.Attribute("type") != null)
                {
                    type = obj.Attribute("type").Value.ToString().ToLower();
                }
                if (type != null && type.Equals("enemy"))
                {
                    var properties = obj.Elements("properties").Elements().ToList();
                    string name = obj.Attribute("name").Value.ToString().ToLower();

                    // default attributes
                    int hp = 100;
                    int mp = 100;
                    int xp = 0;
                    int strength = 10;
                    int defense = 10;

                    int xcoord = Convert.ToInt32(obj.Attribute("x").Value);
                    int ycoord = Convert.ToInt32(obj.Attribute("y").Value);
                    foreach (var prop in properties)
                    {
                        string propName = prop.Attribute("name").ToString().ToLower();
                        switch (propName)
                        {
                            case "strength":
                                strength = Convert.ToInt32(prop.Attribute("value").Value);
                                break;
                            case "hp":
                                hp = Convert.ToInt32(prop.Attribute("value").Value);
                                break;
                            case "mp":
                                mp = Convert.ToInt32(prop.Attribute("value").Value);
                                break;
                            case "defense":
                                defense = Convert.ToInt32(prop.Attribute("value").Value);
                                break;
                            case "xp":
                                xp = Convert.ToInt32(prop.Attribute("value").Value);
                                break;
                        }
                    }

                    switch (name.ToLower())
                    {
                        case "knight":
                            Texture2D knightTexture = game.Content.Load<Texture2D>(@"Characters\charchip01-2-1");
                            Point knightTextureFrameSize = new Point(32, 32);
                            int knightCollisionOffset = 0;
                            Point knightInitialFrame = new Point(1, 0);
                            Point knightSheetSize = new Point(3, 4);
                            Vector2 knightSpeed = new Vector2(1, 1);
                            Vector2 initialKnightPos = new Vector2(xcoord, ycoord);

                            AnimatedSprite knightSprite = new AnimatedSprite(
                                knightTexture, knightTextureFrameSize, knightCollisionOffset, knightInitialFrame, knightSheetSize);

                            List<Vector2> knightTargets = new List<Vector2>() {
                                new Vector2(xcoord - 100, ycoord), new Vector2(xcoord + 100, ycoord) };

                            EnemyCharacter knightEnemy = new Knight(knightSprite, initialKnightPos, hp, mp, xp,
                                strength, defense, knightSpeed, knightTargets, mainCharacter, gameplayScreen);

                            Texture2D knightSwordTexture = game.Content.Load<Texture2D>(@"Attacks\small_sword");
                            int knightSwordMsPerFrame = 16;
                            float knightSwordScale = 0.4f;
                            Vector2 knightSwordRotationPoint = new Vector2(7, 150);

                            SwordSprite knightSwordSprite = new SwordSprite(knightSwordTexture, knightSwordMsPerFrame, knightSwordScale,
                                knightSwordRotationPoint, knightEnemy);
                            knightEnemy.Sword = knightSwordSprite;

                            enemies.Add(knightEnemy);

                            break;
                    }
                }
            }

            return enemies;
        }
Ejemplo n.º 30
0
 public SpaceWorld(Game game, SpriteSheet spriteSheet, GameplayScreen screen)
     : this(game, spriteSheet, screen, false)
 {
 }
Ejemplo n.º 31
0
 /// <summary>
 /// Creates a new instance of the target component.
 /// </summary>
 /// <param name="game">Associated game object.</param>
 /// <param name="gameScreen">Game screen where the component will be presented.</param>
 /// <param name="animation">Animation which represents the component.</param>
 public Target(Game game, GameplayScreen gameScreen, Animation animation)
     : base(game, gameScreen, animation)
 {
 }
Ejemplo n.º 32
0
 public LaserTower(GameplayScreen gamePlayScreen)
     : base(gamePlayScreen)
 {
 }
Ejemplo n.º 33
0
 public override void Run(GameTime gameTime)
 {
     GameplayScreen.AddAlliedShip(Ship, Tag);
 }
Ejemplo n.º 34
0
 public Stairway(GameplayScreen screen, Vector2 pkaardiAsukoht)
     : base(screen, pkaardiAsukoht, "stairway3", -1)
 {
 }
Ejemplo n.º 35
0
 /// <summary>
 /// Creates a new instance of the target component.
 /// </summary>
 /// <param name="game">Associated game object.</param>
 /// <param name="gameScreen">Game screen where the component will be presented.</param>
 /// <param name="texture">Texture which represents the component.</param>
 public Target(Game game, GameplayScreen gameScreen, Texture2D texture)
     : base(game, gameScreen, texture)
 {
 }
        /// <summary>
        ///     Ctor
        /// </summary>
        /// <param name="screen"></param>
        /// <param name="playfield"></param>
        public GameplayPlayfieldKeysStage(GameplayScreen screen, GameplayPlayfieldKeys playfield)
        {
            Screen    = screen;
            Playfield = playfield;

            CreateStageLeft();
            CreateStageRight();
            CreateBgMask();

            // Depending on what the skin.ini's value is, we'll want to either initialize
            // the receptors first, or the playfield first.
            if (Skin.ReceptorsOverHitObjects)
            {
                CreateTimingLineContainer();
                CreateHitObjectContainer();
                CreateReceptorsAndLighting();
                CreateHitPositionOverlay();
            }
            else
            {
                CreateReceptorsAndLighting();
                CreateHitPositionOverlay();
                CreateTimingLineContainer();
                CreateHitObjectContainer();
            }

            CreateDistantOverlay();

            // Depending on what the config value is, we'll display ui elements over the lane cover.
            // Note: Lane cover will always be displayed over the receptors due to the creation order.
            if (ConfigManager.UIElementsOverLaneCover.Value)
            {
                CreateLaneCoverOverlay();
                CreateComboDisplay();
                CreateHitError();
                CreateHitLighting();
                CreateJudgementHitBurst();

                if (OnlineManager.CurrentGame?.Ruleset == MultiplayerGameRuleset.Battle_Royale &&
                    ConfigManager.EnableBattleRoyaleAlerts.Value)
                {
                    CreateBattleRoyaleAlert();
                    CreateBattleRoyaleEliminated();
                }


                CreateSongInfo();
            }
            else
            {
                CreateComboDisplay();
                CreateHitError();
                CreateJudgementHitBurst();
                CreateHitLighting();

                if (OnlineManager.CurrentGame?.Ruleset == MultiplayerGameRuleset.Battle_Royale &&
                    ConfigManager.EnableBattleRoyaleAlerts.Value)
                {
                    CreateBattleRoyaleAlert();
                    CreateBattleRoyaleEliminated();
                }

                CreateSongInfo();
                CreateLaneCoverOverlay();
            }

            CreateHealthBar();
        }
Ejemplo n.º 37
0
 /// <summary>
 /// Default Constructor
 /// </summary>
 /// <param name="name">Name of the main character.</param>
 /// <param name="sprite">The animated sprite object for the main chracter.</param>
 /// <param name="position">The initial position of the character.</param>
 /// <param name="hitPoints">The number of hitpoints (life) the character has</param>
 /// <param name="manaPoints">The number of mana points the character has</param>
 /// <param name="expLevel">The number of EXP to level up</param>
 /// <param name="strength">The strength attribute</param>
 /// <param name="defense">The defense attribute</param>
 /// <param name="speed">The movement speed of the character</param>
 /// <param name="gameplayScreen">The gameplay screen for the game.</param>
 public MainCharacter(String name, AnimatedSprite sprite, Vector2 position, int hitPoints, int manaPoints,
     int expLevel, int strength, int defense, Vector2 speed, GameplayScreen gameplayScreen)
     : base(sprite, position, hitPoints, manaPoints, expLevel, strength, defense, speed, gameplayScreen)
 {
     this.Name = name;
 }
Ejemplo n.º 38
0
 void UndoBaseGameAwardedEnquipment(GameplayScreen gameplayScreen)
 {
     Level.GameSave.Inventory.EquipmentInventory.RemoveItem(ItemInfo.BestiaryItemDropSpecification.Item, 1);
     gameplayScreen.HideItemPickupBar();
 }
		public override void HandleInput (InputState input)
		{
			if (isLoading == true) {
				base.HandleInput (input);
				return;
			}
			PlayerIndex player;
			if (input.IsNewKeyPress (Microsoft.Xna.Framework.Input.Keys.Space, ControllingPlayer, out player) ||
			    input.IsNewKeyPress (Microsoft.Xna.Framework.Input.Keys.Enter, ControllingPlayer, out player) ||
			    input.MouseGesture.HasFlag(MouseGestureType.LeftClick)||
			    input.IsNewButtonPress (Microsoft.Xna.Framework.Input.Buttons.Start, ControllingPlayer, out player)) {
				// Create a new instance of the gameplay screen
				gameplayScreen = new GameplayScreen ();
				gameplayScreen.ScreenManager = ScreenManager;

				// Start loading the resources in additional thread
#if MACOS
				// create a new thread using BackgroundWorkerThread as method to execute
				thread = new Thread (LoadAssetsWorkerThread as ThreadStart);
#else
				thread = new System.Threading.Thread (new System.Threading.ThreadStart (gameplayScreen.LoadAssets));
#endif
				isLoading = true;
				// start it
				thread.Start ();

			}

			foreach (var gesture in input.Gestures) {
				if (gesture.GestureType == GestureType.Tap) {
					// Create a new instance of the gameplay screen
					gameplayScreen = new GameplayScreen ();
					gameplayScreen.ScreenManager = ScreenManager;

					// Start loading the resources in additional thread
					thread = new System.Threading.Thread (new System.Threading.ThreadStart (gameplayScreen.LoadAssets));
					isLoading = true;
					thread.Start ();
				}
			}

			base.HandleInput (input);
		}
Ejemplo n.º 40
0
 public PDVPersian(Game game, GameplayScreen screen)
     : base(game, screen)
 {
     RotationOffset = MathHelper.PiOver2;
 }
Ejemplo n.º 41
0
 public LoadingScreen(GameplayScreen screenToTransitionTo) :
     base("LoadingScreen")
 {
     ScreenToTransitionTo = screenToTransitionTo;
     MusicQueueType       = QueueType.PlayImmediately;
 }
Ejemplo n.º 42
0
        public Level4(Game game, GameplayScreen host)
            : base(game, host)
        {
            startingLocation = new Vector3(1f, 35f, 100f);
            //make a few planes

            CollisionLevelPiece currentPlane;

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 15;
            currentPlane.position += new Vector3(0f, 0f, 0);
            planes.Add(currentPlane);

            //Left arm


            //large arm

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 9;
            currentPlane.position += new Vector3(-180f, 0f, -288);
            planes.Add(currentPlane);

            //smaller arms
            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(-252f, 0f, -432);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(-108f, 0f, -432);
            planes.Add(currentPlane);

            //tiny arm

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(-252f, 0f, -480);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(-108f, 0f, -480);
            planes.Add(currentPlane);


            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(-252f, 0f, -504);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(-108f, 0f, -504);
            planes.Add(currentPlane);


            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(-252f, 0f, -528);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(-108f, 0f, -528);
            planes.Add(currentPlane);


            //small arm

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(-252f, 0f, -576);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(-108f, 0f, -576);
            planes.Add(currentPlane);

            //large arm

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 9;
            currentPlane.position += new Vector3(-180f, 0f, -720);
            planes.Add(currentPlane);



            //Right arm

            //large arm

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 9;
            currentPlane.position += new Vector3(180f, 0f, -288);
            planes.Add(currentPlane);

            //smaller arms


            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(252f, 0f, -432);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(108f, 0f, -432);
            planes.Add(currentPlane);

            //tiny arms

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(252f, 0f, -480);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(108f, 0f, -480);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(252f, 0f, -504);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(108f, 0f, -504);
            planes.Add(currentPlane);


            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(252f, 0f, -528);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(108f, 0f, -528);
            planes.Add(currentPlane);


            //small arms

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(252f, 0f, -576);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(108f, 0f, -576);
            planes.Add(currentPlane);

            //large arm

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 9;
            currentPlane.position += new Vector3(180f, 0f, -720);
            planes.Add(currentPlane);



            //connecting bar

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 2;
            currentPlane.position += new Vector3(48f, 0f, -804);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 2;
            currentPlane.position += new Vector3(-48f, 0f, -804);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 2;
            currentPlane.position += new Vector3(0f, 0f, -804);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 2;
            currentPlane.position += new Vector3(0f, 0f, -852);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 2;
            currentPlane.position += new Vector3(0f, 0f, -900);
            planes.Add(currentPlane);



            //goal
            goal           = new GoalObject(game, host);
            goal.position += new Vector3(0, 10, -1000);
            goal.scale     = 10;

            //collectables

            //death bound for this level
            m_fDeathBound = -250f;
        }
Ejemplo n.º 43
0
 public Tile_w1_r1_c0(GameplayScreen gameplayScreen, IWorld world)
     : base(gameplayScreen, new Vector2(500, 400), world)
 {
     _gameplayScreen = gameplayScreen;
 }
Ejemplo n.º 44
0
 public Powerup(GameplayScreen screen, Vector2 pkaardiAsukoht)
     : base(screen, pkaardiAsukoht, "powerup", 30)
 {
 }
Ejemplo n.º 45
0
 /// <summary>
 /// Creates a new instance of the launched game component.
 /// </summary>
 /// <param name="game">Associated game object.</param>
 /// <param name="gameScreen">Game screen where the component will be presented.</param>
 /// <param name="animation">Animation object which represents the component.</param>
 public LaunchedComponent(Game game, GameplayScreen gameScreen, Animation animation)
     : base(game, gameScreen, animation)
 {
 }
 /// <summary>
 /// Creates a new component instance.
 /// </summary>
 /// <param name="game">Associated game object.</param>
 /// <param name="gameScreen">Game screen where the component will be presented.</param>
 /// <param name="animation">An animation that the component will display.</param>
 public DisappearingAnimationComponent(Game game, GameplayScreen gameScreen, Animation animation)
     : base(game, gameScreen, animation)
 {
 }
Ejemplo n.º 47
0
 public void LoadLevel(GameplayScreen gameScreen)
 {
     LoadingScreen.Load(this, true, gameScreen.ControllingPlayer, gameScreen);
 }
Ejemplo n.º 48
0
 public GameplayComponent(GameplayScreen screen)
 {
     this.Screen = screen;
 }
Ejemplo n.º 49
0
        /// <inheritdoc />
        /// <summary>
        ///     Ctor
        /// </summary>
        /// <param name="screen"></param>
        /// <param name="type"></param>
        /// <param name="username"></param>
        /// <param name="judgements"></param>
        /// <param name="avatar"></param>
        /// <param name="mods"></param>
        /// <param name="score"></param>
        /// <exception cref="T:System.ComponentModel.InvalidEnumArgumentException"></exception>
        internal ScoreboardUser(GameplayScreen screen, ScoreboardUserType type, string username, List <Judgement> judgements, Texture2D avatar, ModIdentifier mods, Score score = null)
        {
            Screen          = screen;
            LocalScore      = score;
            Judgements      = judgements;
            UsernameRaw     = username;
            RatingProcessor = new RatingProcessorKeys(MapManager.Selected.Value.DifficultyFromMods(mods));
            Type            = type;
            Size            = new ScalableVector2(260, 50);

            // Set position initially to offscreen
            X = -Width - 10;

            // The alpha of the tect - determined by the scoreboard user type.
            float textAlpha;

            // Set props based on the type of scoreboard user this is.
            switch (Type)
            {
            case ScoreboardUserType.Self:
                Image     = SkinManager.Skin.Scoreboard;
                Alpha     = 1f;
                textAlpha = 1f;
                break;

            case ScoreboardUserType.Other:
                Image     = SkinManager.Skin.ScoreboardOther;
                Alpha     = 0.75f;
                textAlpha = 0.65f;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            switch (Screen.Map.Mode)
            {
            case GameMode.Keys4:
            case GameMode.Keys7:
                Processor = Type == ScoreboardUserType.Other ? new ScoreProcessorKeys(Screen.Map, mods) : Screen.Ruleset.ScoreProcessor;
                break;

            default:
                throw new InvalidEnumArgumentException();
            }

            // Create avatar
            Avatar = new Sprite()
            {
                Parent    = this,
                Size      = new ScalableVector2(Height, Height),
                Alignment = Alignment.MidLeft,
                Image     = avatar,
            };

            if (Type != ScoreboardUserType.Self)
            {
                if (LocalScore != null && LocalScore.IsOnline)
                {
                    // Check to see if we have a Steam avatar for this user cached.
                    if (SteamManager.UserAvatars.ContainsKey((ulong)LocalScore.SteamId))
                    {
                        Avatar.Image = SteamManager.UserAvatars[(ulong)LocalScore.SteamId];
                    }
                    else
                    {
                        Avatar.Alpha = 0;
                        Avatar.Image = UserInterface.UnknownAvatar;

                        // Otherwise we need to request for it.
                        SteamManager.SteamUserAvatarLoaded += OnAvatarLoaded;
                        SteamManager.SendAvatarRetrievalRequest((ulong)LocalScore.SteamId);
                    }
                }
                else
                {
                    Avatar.Image = UserInterface.UnknownAvatar;
                }
            }

            // Create username text.
            Username = new SpriteText(Fonts.Exo2Bold, GetUsernameFormatted(), 13)
            {
                Parent    = this,
                Alignment = Alignment.TopLeft,
                Alpha     = textAlpha,
                X         = Avatar.Width + 10,
            };

            // Create score text.
            Score = new SpriteTextBitmap(FontsBitmap.AllerRegular, "0.00")
            {
                Parent    = this,
                Alignment = Alignment.TopLeft,
                Alpha     = textAlpha,
                Y         = Username.Y + Username.Height + 2,
                X         = Username.X,
                FontSize  = 18
            };

            // Create score text.
            Combo = new SpriteTextBitmap(FontsBitmap.AllerRegular, $"{Processor.Combo:N0}x")
            {
                Parent    = this,
                Alignment = Alignment.MidRight,
                Alpha     = textAlpha,
                FontSize  = 18,
                X         = -5
            };
        }
Ejemplo n.º 50
0
        public GameplayGameState(IGameController gameController)
        {
            this.Visible = true;

            this.gameplayScreen = new GameplayScreen(gameController);
        }
Ejemplo n.º 51
0
 public override void PerformImmediately()
 {
     GameplayScreen.AddAlliedShip(Ship, Tag);
     Done = true;
 }
        public void Update(GameTime gameTime, GameplayScreen.LevelState levelState, Vector2 fruitShotLocation, bool shotExpired)
        {
            if (GameSettings.isBoss) UpdateTowers(gameTime);

            if (HazardSprites.Count > 0)
            {
                for (int i = HazardSprites.Count - 1; i >= 0; i--)
                {
                    HazardSprites[i].Update(gameTime);

                    switch (HazardSprites[i].SpriteType)
                    {
                        case Sprite.Type.Windmill:
                            {
                                HazardSprites[i].TotalRotation += 0.005f;
                                HazardSprites[i].spriteBody.Rotation = HazardSprites[i].TotalRotation;
                                break;
                            }
                        case Sprite.Type.Fan:
                            {
                                if (HazardSprites[i].spriteBody.Enabled && HazardSprites[i].IsAwake)
                                {
                                    HazardSprites[i].Velocity += (int)(gameTime.ElapsedGameTime.Milliseconds);

                                    if (HazardSprites[i].Velocity > HazardSprites[i].HitPoints) //is timer over the fan on threshold
                                    {
                                        if (HazardSprites[i].IsAnimated == false) //if fan coming from off state
                                        {
                                            //turn fan on
                                            HazardSprites[i].IsAnimated = true;
                                            HazardSprites[i].Velocity = HazardSprites[i].HitPoints; //sync to effect

                                            //resets contacts, so things starting in fan wind will throw the contact event
                                            HazardSprites[i].spriteBody.Enabled = false;
                                            HazardSprites[i].spriteBody.Enabled = true;

                                            //indefinately animated fan setup
                                            if (HazardSprites[i].HitPoints == 0)
                                            {
                                                HazardSprites[i].Velocity = int.MaxValue;
                                            }

                                            contactListener.ActivateFan(HazardSprites[i]);//the effect manager listens for this event and creates/manages the wind effect
                                        }
                                        else //fan is already on, and running--generate wind
                                        {
                                            if(LevelDataManager.rand.Next(0,2) == 0) contactListener.CreateWindParticle(HazardSprites[i]);
                                        }
                                    }

                                    //timer at threshold to turn fan off
                                    if (HazardSprites[i].Velocity >= 2 * HazardSprites[i].HitPoints && HazardSprites[i].HitPoints != 0)
                                    {
                                        //turn fan off--code is in effect sprite to turn effect off
                                        HazardSprites[i].IsAnimated = false;
                                        HazardSprites[i].CurrentFrame = 0;
                                        HazardSprites[i].Velocity = 0f; //reset hp
                                    }
                                }
                                if (HazardSprites[i].pathing == Sprite.Pathing.None) HazardSprites[i].spriteBody.ResetDynamics();
                                break;
                            }
                        case Sprite.Type.Saw:
                            {
                                if (HazardSprites[i].IsRotating)
                                {
                                    HazardSprites[i].TotalRotation += sawSpeed;
                                    HazardSprites[i].spriteBody.SetTransform(ConvertUnits.ToSimUnits(HazardSprites[i].SpriteCenterInWorld), HazardSprites[i].TotalRotation);
                                }

                                if (HazardSprites[i].pathing == Sprite.Pathing.None) HazardSprites[i].spriteBody.ResetDynamics();

                                break;
                            }
                        case Sprite.Type.Smasher:
                            {
                                #region SMAHSER (SPIDER) PATHING
                                float distance = Math.Abs(HazardSprites[i].PathingSpeed) * (float)gameTime.ElapsedGameTime.TotalSeconds;
                                float rangeX = HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X - HazardSprites[i].Location.X;
                                float rangeY = HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y - HazardSprites[i].Location.Y;
                                float range = (float)Math.Sqrt((double)((rangeX * rangeX) + (rangeY * rangeY)));
                                Vector2 direction = new Vector2(rangeX / range, rangeY / range);

                                if (HazardSprites[i].IsPathingInertia)
                                {
                                    if ((range >= (distance * 20f)) && (HazardSprites[i].pathingTravelled >= (distance * 20f)))
                                    {
                                        HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                        HazardSprites[i].pathingTravelled += distance;
                                    }
                                    else
                                    {
                                        if (range < (distance * 20f)) distance = range / 20f;
                                        if (HazardSprites[i].pathingTravelled < (distance * 20f)) distance = Math.Max(HazardSprites[i].pathingTravelled / 20f, 0.5f);
                                        HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                        HazardSprites[i].pathingTravelled += distance;
                                        if (range <= 0.5f)
                                        {
                                            HazardSprites[i].Location = new Vector2(HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X,
                                                                                    HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y);

                                            HazardSprites[i].Timer += (float)gameTime.ElapsedGameTime.TotalSeconds;
                                            if (HazardSprites[i].Timer >= HazardSprites[i].TimeDelay)
                                            {
                                                HazardSprites[i].Timer = 0f;
                                                HazardSprites[i].pathingTravelled = 0f;
                                                if (HazardSprites[i].pathingPointsDestinationIndex == 1)
                                                {
                                                    HazardSprites[i].pathingPointsDestinationIndex = 0;
                                                    return;
                                                }
                                                if (HazardSprites[i].pathingPointsDestinationIndex == 0)
                                                {
                                                    HazardSprites[i].pathingPointsDestinationIndex = 1;
                                                    return;
                                                }
                                            }
                                        }
                                    }
                                }
                                if (!HazardSprites[i].IsPathingInertia)
                                {
                                    if (range >= distance)
                                    {
                                        HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                    }
                                    else
                                    {
                                        HazardSprites[i].Location = new Vector2(HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X,
                                                                                HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y);

                                        HazardSprites[i].Timer += (float)gameTime.ElapsedGameTime.TotalSeconds;
                                        if (HazardSprites[i].Timer >= HazardSprites[i].TimeDelay)
                                        {
                                            HazardSprites[i].Timer = 0f;
                                            HazardSprites[i].pathingTravelled = 0f;
                                            if (HazardSprites[i].pathingPointsDestinationIndex == 1)
                                            {
                                                HazardSprites[i].pathingPointsDestinationIndex = 0;
                                                return;
                                            }
                                            if (HazardSprites[i].pathingPointsDestinationIndex == 0)
                                            {
                                                HazardSprites[i].pathingPointsDestinationIndex = 1;
                                                return;
                                            }
                                        }
                                    }
                                }
                                HazardSprites[i].spriteBody.SetTransform(ConvertUnits.ToSimUnits(HazardSprites[i].SpriteCenterInWorld), HazardSprites[i].TotalRotation);

                                if (HazardSprites[i].IsHit) contactListener.DoPoof(HazardSprites[i]);
                                break;
                                #endregion
                            }
                        case Sprite.Type.Bat:
                            {
                                #region BAT PATHING
                                float distance = Math.Abs(HazardSprites[i].PathingSpeed) * (float)gameTime.ElapsedGameTime.TotalSeconds;
                                float rangeX = HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X - HazardSprites[i].Location.X;
                                float rangeY = HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y - HazardSprites[i].Location.Y;
                                float range = (float)Math.Sqrt((double)((rangeX * rangeX) + (rangeY * rangeY)));
                                Vector2 direction = new Vector2(rangeX / range, rangeY / range);

                                //wobble
                                HazardSprites[i].Velocity += (float)gameTime.ElapsedGameTime.TotalSeconds;
                                if (HazardSprites[i].Velocity < 0.25f)
                                {
                                    HazardSprites[i].Direction = new Vector2 (0,1);
                                }
                                else
                                {
                                    HazardSprites[i].Direction = new Vector2(0,-1);
                                    if (HazardSprites[i].Velocity >= 0.50) HazardSprites[i].Velocity = 0f;
                                }

                                //facing
                                if (rangeX < 0) HazardSprites[i].IsFlippedHorizontally = true;
                                else HazardSprites[i].IsFlippedHorizontally = false;

                                if (HazardSprites[i].IsPathingInertia)
                                {
                                    if ((range >= (distance * 20f)) && (HazardSprites[i].pathingTravelled >= (distance * 20f)))
                                    {
                                        HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                        HazardSprites[i].pathingTravelled += distance;
                                    }
                                    else
                                    {
                                        if (range < (distance * 20f)) distance = range / 20f;
                                        if (HazardSprites[i].pathingTravelled < (distance * 20f)) distance = Math.Max(HazardSprites[i].pathingTravelled / 20f, 0.5f);
                                        HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                        HazardSprites[i].pathingTravelled += distance;
                                        if (range <= 0.5f)
                                        {
                                            HazardSprites[i].Location = new Vector2(HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X,
                                                                                    HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y);

                                            HazardSprites[i].Timer += (float)gameTime.ElapsedGameTime.TotalSeconds;
                                            if (HazardSprites[i].Timer >= HazardSprites[i].TimeDelay)
                                            {
                                                HazardSprites[i].Timer = 0f;
                                                HazardSprites[i].pathingTravelled = 0f;
                                                if (HazardSprites[i].pathingPointsDestinationIndex == 1)
                                                {
                                                    HazardSprites[i].pathingPointsDestinationIndex = 0;
                                                    return;
                                                }
                                                if (HazardSprites[i].pathingPointsDestinationIndex == 0)
                                                {
                                                    HazardSprites[i].pathingPointsDestinationIndex = 1;
                                                    return;
                                                }
                                            }
                                        }
                                    }
                                }
                                if (!HazardSprites[i].IsPathingInertia)
                                {
                                    if (range >= distance)
                                    {
                                        HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                    }
                                    else
                                    {
                                        HazardSprites[i].Location = new Vector2(HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X,
                                                                                HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y);

                                        HazardSprites[i].Timer += (float)gameTime.ElapsedGameTime.TotalSeconds;
                                        if (HazardSprites[i].Timer >= HazardSprites[i].TimeDelay)
                                        {
                                            HazardSprites[i].Timer = 0f;
                                            HazardSprites[i].pathingTravelled = 0f;
                                            if (HazardSprites[i].pathingPointsDestinationIndex == 1)
                                            {
                                                HazardSprites[i].pathingPointsDestinationIndex = 0;
                                                return;
                                            }
                                            if (HazardSprites[i].pathingPointsDestinationIndex == 0)
                                            {
                                                HazardSprites[i].pathingPointsDestinationIndex = 1;
                                                return;
                                            }
                                        }
                                    }
                                }
                                HazardSprites[i].Location += new Vector2(0, HazardSprites[i].Direction.Y);
                                HazardSprites[i].spriteBody.SetTransform(ConvertUnits.ToSimUnits(HazardSprites[i].SpriteCenterInWorld), HazardSprites[i].TotalRotation);
                                if (HazardSprites[i].IsHit) contactListener.ExplodeCreature(HazardSprites[i]);
                                break;
                                #endregion
                            }
                        case Sprite.Type.Spider:
                            {
                                #region SPIDER PATHING
                                float distance = Math.Abs(HazardSprites[i].PathingSpeed) * (float)gameTime.ElapsedGameTime.TotalSeconds;
                                float rangeX = HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X - HazardSprites[i].Location.X;
                                float rangeY = HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y - HazardSprites[i].Location.Y;
                                float range = (float)Math.Sqrt((double)((rangeX * rangeX) + (rangeY * rangeY)));
                                Vector2 direction = new Vector2(rangeX / range, rangeY / range);

                                if (HazardSprites[i].IsPathingInertia)
                                {
                                    if ((range >= (distance * 20f)) && (HazardSprites[i].pathingTravelled >= (distance * 20f)))
                                    {
                                        HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                        HazardSprites[i].pathingTravelled += distance;
                                    }
                                    else
                                    {
                                        if (range < (distance * 20f)) distance = range / 20f;
                                        if (HazardSprites[i].pathingTravelled < (distance * 20f)) distance = Math.Max(HazardSprites[i].pathingTravelled / 20f, 0.5f);
                                        HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                        HazardSprites[i].pathingTravelled += distance;
                                        if (range <= 0.5f)
                                        {
                                            HazardSprites[i].Location = new Vector2(HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X,
                                                                                    HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y);

                                            HazardSprites[i].Timer += (float)gameTime.ElapsedGameTime.TotalSeconds;
                                            if (HazardSprites[i].Timer >= HazardSprites[i].TimeDelay)
                                            {
                                                HazardSprites[i].Timer = 0f;
                                                HazardSprites[i].pathingTravelled = 0f;
                                                if (HazardSprites[i].pathingPointsDestinationIndex == 1)
                                                {
                                                    HazardSprites[i].pathingPointsDestinationIndex = 0;
                                                    return;
                                                }
                                                if (HazardSprites[i].pathingPointsDestinationIndex == 0)
                                                {
                                                    HazardSprites[i].pathingPointsDestinationIndex = 1;
                                                    return;
                                                }
                                            }
                                        }
                                    }
                                }
                                if (!HazardSprites[i].IsPathingInertia)
                                {
                                    if (range >= distance)
                                    {
                                        HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                    }
                                    else
                                    {
                                        HazardSprites[i].Location = new Vector2(HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X,
                                                                                HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y);

                                        HazardSprites[i].Timer += (float)gameTime.ElapsedGameTime.TotalSeconds;
                                        if (HazardSprites[i].Timer >= HazardSprites[i].TimeDelay)
                                        {
                                            HazardSprites[i].Timer = 0f;
                                            HazardSprites[i].pathingTravelled = 0f;
                                            if (HazardSprites[i].pathingPointsDestinationIndex == 1)
                                            {
                                                HazardSprites[i].pathingPointsDestinationIndex = 0;
                                                return;
                                            }
                                            if (HazardSprites[i].pathingPointsDestinationIndex == 0)
                                            {
                                                HazardSprites[i].pathingPointsDestinationIndex = 1;
                                                return;
                                            }
                                        }
                                    }
                                }
                                HazardSprites[i].spriteBody.SetTransform(ConvertUnits.ToSimUnits(HazardSprites[i].SpriteCenterInWorld), HazardSprites[i].TotalRotation);

                                if (HazardSprites[i].IsHit) contactListener.ExplodeCreature(HazardSprites[i]);

                                //create spider thread each tick
                                contactListener.CreateSpiderThread(HazardSprites[i]);
                                break;
                                #endregion
                            }

                        case Sprite.Type.Fish:
                        case Sprite.Type.FireBoo:
                            {
                                #region FISH PATHING
                                //jump timer
                                HazardSprites[i].Timer += (float)gameTime.ElapsedGameTime.TotalSeconds;
                                if (HazardSprites[i].Timer > HazardSprites[i].TimeDelay)
                                {
                                    //initialize values for jump
                                    if (HazardSprites[i].pathingPoints[2] == Vector2.Zero)
                                    {
                                        HazardSprites[i].pathingPoints[2] = HazardSprites[i].Location;
                                        HazardSprites[i].pathingPoints[4] = new Vector2(HazardSprites[i].PathingRadiusX, HazardSprites[i].PathingRadiusY);
                                        HazardSprites[i].pathingPoints[5] = new Vector2(HazardSprites[i].PathingSpeed, HazardSprites[i].pathingTravelled);
                                        HazardSprites[i].pathingTravelled = 3.1416f;
                                        HazardSprites[i].PathingSpeed = 50 + (30000 / HazardSprites[i].PathingRadiusY);
                                        HazardSprites[i].PathingRadiusX = (int)(HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X - HazardSprites[i].Location.X);
                                        HazardSprites[i].pathingPoints[3] = new Vector2(HazardSprites[i].Location.X + HazardSprites[i].PathingRadiusX / 2,
                                                                                        HazardSprites[i].Location.Y);

                                        if (HazardSprites[i].SpriteType == Sprite.Type.Fish)
                                        {
                                            if (Camera.IsObjectVisible(HazardSprites[i].SpriteRectangle, Vector2.One)) contactListener.SplashWater(HazardSprites[i]);
                                        }
                                        if (HazardSprites[i].SpriteType == Sprite.Type.FireBoo)
                                        {
                                            if (Camera.IsObjectVisible(HazardSprites[i].SpriteRectangle, Vector2.One)) contactListener.SplashLava(HazardSprites[i]);
                                        }
                                    }

                                    //jump pathing
                                    float distance = HazardSprites[i].PathingSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;
                                    HazardSprites[i].pathingTravelled += MathHelper.ToRadians(distance);
                                    HazardSprites[i].Location = new Vector2(HazardSprites[i].pathingPoints[3].X + (float)(Math.Cos(HazardSprites[i].pathingTravelled) * HazardSprites[i].PathingRadiusX / 2f),
                                                            HazardSprites[i].pathingPoints[3].Y + (float)(Math.Sin(HazardSprites[i].pathingTravelled) * HazardSprites[i].PathingRadiusY / 2f));
                                    if (HazardSprites[i].PathingRadiusX > 0) HazardSprites[i].TotalRotation = HazardSprites[i].pathingTravelled - MathHelper.ToRadians(180);
                                    else HazardSprites[i].TotalRotation = (HazardSprites[i].pathingTravelled - MathHelper.ToRadians(180)) * -1;

                                    if (HazardSprites[i].pathingTravelled > 6.2832f)
                                    {
                                        //jump deinitialize
                                        HazardSprites[i].Timer = 0f;
                                        HazardSprites[i].pathingPoints[2] = Vector2.Zero;
                                        HazardSprites[i].PathingRadiusX = (int)HazardSprites[i].pathingPoints[4].X;
                                        HazardSprites[i].PathingSpeed = (int)HazardSprites[i].pathingPoints[5].X;
                                        HazardSprites[i].TotalRotation = 0f;
                                        if (HazardSprites[i].SpriteType == Sprite.Type.Fish)
                                        {
                                            if (Camera.IsObjectVisible(HazardSprites[i].SpriteRectangle, Vector2.One)) contactListener.SplashWater(HazardSprites[i]);
                                        }
                                        if (HazardSprites[i].SpriteType == Sprite.Type.FireBoo)
                                        {
                                            if (Camera.IsObjectVisible(HazardSprites[i].SpriteRectangle, Vector2.One)) contactListener.SplashLava(HazardSprites[i]);
                                        }
                                    }
                                    HazardSprites[i].spriteBody.SetTransform(ConvertUnits.ToSimUnits(HazardSprites[i].SpriteCenterInWorld), HazardSprites[i].TotalRotation);
                                    if (HazardSprites[i].AnimationFramePrecise < 0.2f)
                                    {
                                        if (HazardSprites[i].SpriteType == Sprite.Type.Fish) contactListener.CreateDrop(HazardSprites[i]);
                                        if (HazardSprites[i].SpriteType == Sprite.Type.FireBoo)
                                        {
                                            contactListener.CreateEmber(HazardSprites[i]);
                                            contactListener.DoPoof(HazardSprites[i]);
                                        }
                                    }
                                }

                                //swimming horizonally (linear) behaivior
                                if (HazardSprites[i].Timer <= HazardSprites[i].TimeDelay)
                                {
                                    float distance = Math.Abs(HazardSprites[i].PathingSpeed) * (float)gameTime.ElapsedGameTime.TotalSeconds;
                                    float rangeX = HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X - HazardSprites[i].Location.X;
                                    float rangeY = HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y - HazardSprites[i].Location.Y;
                                    float range = (float)Math.Sqrt((double)((rangeX * rangeX) + (rangeY * rangeY)));
                                    Vector2 direction = new Vector2(rangeX / range, rangeY / range);

                                    //facing
                                    if ((HazardSprites[i].Location.X - HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X) > 0) HazardSprites[i].IsFlippedHorizontally = true;
                                    else HazardSprites[i].IsFlippedHorizontally = false;

                                    if (HazardSprites[i].IsPathingInertia)
                                    {
                                        if ((range >= (distance * 20f)) && (HazardSprites[i].pathingTravelled >= (distance * 20f)))
                                        {
                                            HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                            HazardSprites[i].pathingTravelled += distance;
                                        }
                                        else
                                        {
                                            if (range < (distance * 20f)) distance = range / 20f;
                                            if (HazardSprites[i].pathingTravelled < (distance * 20f)) distance = Math.Max(HazardSprites[i].pathingTravelled / 20f, 0.5f);
                                            HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                            HazardSprites[i].pathingTravelled += distance;
                                            if (range <= 0.5f)
                                            {
                                                HazardSprites[i].Location = new Vector2(HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X,
                                                                                        HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y);
                                                HazardSprites[i].pathingTravelled = 0f;
                                                if (HazardSprites[i].pathingPointsDestinationIndex == 1)
                                                {
                                                    HazardSprites[i].pathingPointsDestinationIndex = 0;
                                                    return;
                                                }
                                                if (HazardSprites[i].pathingPointsDestinationIndex == 0)
                                                {
                                                    HazardSprites[i].pathingPointsDestinationIndex = 1;
                                                    return;
                                                }
                                            }
                                        }

                                    }
                                    if (!HazardSprites[i].IsPathingInertia)
                                    {
                                        if (range >= distance)
                                        {
                                            HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                        }
                                        else
                                        {
                                            HazardSprites[i].Location = new Vector2(HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X,
                                                                                     HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y);
                                            HazardSprites[i].pathingTravelled = 0f;
                                            if (HazardSprites[i].pathingPointsDestinationIndex == 1)
                                            {
                                                HazardSprites[i].pathingPointsDestinationIndex = 0;
                                                return;
                                            }
                                            if (HazardSprites[i].pathingPointsDestinationIndex == 0)
                                            {
                                                HazardSprites[i].pathingPointsDestinationIndex = 1;
                                                return;
                                            }
                                        }
                                    }
                                }
                                HazardSprites[i].spriteBody.SetTransform(ConvertUnits.ToSimUnits(HazardSprites[i].SpriteCenterInWorld), HazardSprites[i].TotalRotation);
                                if (HazardSprites[i].IsHit) contactListener.ExplodeCreature(HazardSprites[i]);
                                break;
                                #endregion
                            }

                        case Sprite.Type.Bird:
                            {
                                #region BIRD PATHING
                                //swoop timer
                                if (levelState == GameplayScreen.LevelState.Fire)
                                {
                                    float rangeX = fruitShotLocation.X - HazardSprites[i].Location.X;
                                    float rangeY = fruitShotLocation.Y - HazardSprites[i].Location.Y;
                                    //trigger a swoop if the fruit is near and below
                                    if ((Math.Abs(rangeX) < 200) && rangeY > 0) HazardSprites[i].Timer = HazardSprites[i].TimeDelay + 1;
                                }
                                else
                                {
                                    HazardSprites[i].Timer += (float)gameTime.ElapsedGameTime.TotalSeconds;
                                }

                                //swoop
                                if (HazardSprites[i].Timer > HazardSprites[i].TimeDelay)
                                {

                                    //initialize values for swoop
                                    if (HazardSprites[i].pathingPoints[2] == Vector2.Zero)
                                    {
                                        HazardSprites[i].pathingPoints[2] = HazardSprites[i].Location;
                                        HazardSprites[i].pathingPoints[4] = new Vector2(HazardSprites[i].PathingRadiusX, HazardSprites[i].PathingRadiusY);
                                        HazardSprites[i].pathingPoints[5] = new Vector2(HazardSprites[i].PathingSpeed, HazardSprites[i].pathingTravelled);
                                        HazardSprites[i].pathingTravelled = -3.14f;
                                        HazardSprites[i].PathingSpeed = (HazardSprites[i].PathingSpeed * 3) / 4;
                                        if ((HazardSprites[i].Location.X - HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X) >= 0)
                                            HazardSprites[i].PathingRadiusX = -200;
                                        else HazardSprites[i].PathingRadiusX = 200;
                                        HazardSprites[i].pathingPoints[3] = new Vector2(HazardSprites[i].Location.X + HazardSprites[i].PathingRadiusX / 2,
                                                                                        HazardSprites[i].Location.Y);

                                        if (Camera.IsObjectVisible(HazardSprites[i].SpriteRectangle, Vector2.One)) SoundManager.Play(SoundManager.Sound.AnimalBird, false, true);
                                    }

                                    //swoop pathing
                                    float distance = HazardSprites[i].PathingSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;
                                    HazardSprites[i].pathingTravelled -= MathHelper.ToRadians(distance);
                                    HazardSprites[i].Location = new Vector2(HazardSprites[i].pathingPoints[3].X + (float)(Math.Cos(HazardSprites[i].pathingTravelled) * HazardSprites[i].PathingRadiusX / 2f),
                                                            HazardSprites[i].pathingPoints[3].Y + (float)(Math.Sin(HazardSprites[i].pathingTravelled) * HazardSprites[i].PathingRadiusY / 2f));

                                    if (HazardSprites[i].pathingTravelled < -6.28f)
                                    {
                                        //swoop deinitialize
                                        HazardSprites[i].Timer = 0f;
                                        HazardSprites[i].TimeDelay = LevelDataManager.rand.Next(0, 10);
                                        HazardSprites[i].pathingPoints[2] = Vector2.Zero;
                                        HazardSprites[i].PathingRadiusX = (int)HazardSprites[i].pathingPoints[4].X;
                                        HazardSprites[i].PathingSpeed = (int)HazardSprites[i].pathingPoints[5].X;
                                        HazardSprites[i].TotalRotation = 0f;
                                    }
                                    HazardSprites[i].spriteBody.SetTransform(ConvertUnits.ToSimUnits(HazardSprites[i].SpriteCenterInWorld), HazardSprites[i].TotalRotation);
                                }

                                //flying horizonally (linear) behaivior
                                if (HazardSprites[i].Timer <= HazardSprites[i].TimeDelay)
                                {
                                    float distance = Math.Abs(HazardSprites[i].PathingSpeed) * (float)gameTime.ElapsedGameTime.TotalSeconds;
                                    float rangeX = HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X - HazardSprites[i].Location.X;
                                    float rangeY = HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y - HazardSprites[i].Location.Y;
                                    float range = (float)Math.Sqrt((double)((rangeX * rangeX) + (rangeY * rangeY)));
                                    Vector2 direction = new Vector2(rangeX / range, rangeY / range);

                                    //facing
                                    if ((HazardSprites[i].Location.X - HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X) > 0) HazardSprites[i].IsFlippedHorizontally = true;
                                    else HazardSprites[i].IsFlippedHorizontally = false;

                                    if (HazardSprites[i].IsPathingInertia)
                                    {
                                        if ((range >= (distance * 20f)) && (HazardSprites[i].pathingTravelled >= (distance * 20f)))
                                        {
                                            HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                            HazardSprites[i].pathingTravelled += distance;
                                        }
                                        else
                                        {
                                            if (range < (distance * 20f)) distance = range / 20f;
                                            if (HazardSprites[i].pathingTravelled < (distance * 20f)) distance = Math.Max(HazardSprites[i].pathingTravelled / 20f, 0.5f);
                                            HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                            HazardSprites[i].pathingTravelled += distance;
                                            if (range <= 0.5f)
                                            {
                                                HazardSprites[i].Location = new Vector2(HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X,
                                                                                        HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y);
                                                HazardSprites[i].pathingTravelled = 0f;
                                                if (HazardSprites[i].pathingPointsDestinationIndex == 1)
                                                {
                                                    HazardSprites[i].pathingPointsDestinationIndex = 0;
                                                    return;
                                                }
                                                if (HazardSprites[i].pathingPointsDestinationIndex == 0)
                                                {
                                                    HazardSprites[i].pathingPointsDestinationIndex = 1;
                                                    return;
                                                }
                                            }
                                        }

                                    }
                                    if (!HazardSprites[i].IsPathingInertia)
                                    {
                                        if (range >= distance)
                                        {
                                            HazardSprites[i].Location += new Vector2((direction.X * distance), (direction.Y * distance));
                                        }
                                        else
                                        {
                                            HazardSprites[i].Location = new Vector2(HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].X,
                                                                                     HazardSprites[i].pathingPoints[HazardSprites[i].pathingPointsDestinationIndex].Y);
                                            HazardSprites[i].pathingTravelled = 0f;
                                            if (HazardSprites[i].pathingPointsDestinationIndex == 1)
                                            {
                                                HazardSprites[i].pathingPointsDestinationIndex = 0;
                                                return;
                                            }
                                            if (HazardSprites[i].pathingPointsDestinationIndex == 0)
                                            {
                                                HazardSprites[i].pathingPointsDestinationIndex = 1;
                                                return;
                                            }
                                        }
                                    }
                                }
                                HazardSprites[i].spriteBody.SetTransform(ConvertUnits.ToSimUnits(HazardSprites[i].SpriteCenterInWorld), HazardSprites[i].TotalRotation);
                                if (HazardSprites[i].IsHit) contactListener.ExplodeCreature(HazardSprites[i]);
                                break;
                                #endregion
                            }

                        case Sprite.Type.Gremlin:
                            {
                                #region GREMLIN PATHING
                                if ((levelState == GameplayScreen.LevelState.Fire || levelState == GameplayScreen.LevelState.PowerUpFire) && !shotExpired)
                                {
                                    float distance = Math.Abs(HazardSprites[i].PathingSpeed) * (float)gameTime.ElapsedGameTime.TotalSeconds;
                                    float rangeX = fruitShotLocation.X - HazardSprites[i].Location.X;
                                    float rangeY = fruitShotLocation.Y - HazardSprites[i].Location.Y;
                                    float range = (float)Math.Sqrt((double)((rangeX * rangeX) + (rangeY * rangeY)));
                                    Vector2 direction = new Vector2(rangeX / range, rangeY / range);
                                    Vector2 actualMovement = new Vector2((direction.X * distance), (direction.Y * distance));
                                    HazardSprites[i].Location += actualMovement;
                                    HazardSprites[i].pathingPoints[1] += actualMovement;
                                    HazardSprites[i].spriteBody.SetTransform(ConvertUnits.ToSimUnits(HazardSprites[i].SpriteCenterInWorld), HazardSprites[i].TotalRotation);

                                    //faces the correct direction for movement
                                    if (actualMovement.X < 0) HazardSprites[i].IsFlippedHorizontally = true;
                                    else HazardSprites[i].IsFlippedHorizontally = false;
                                }
                                else
                                {
                                    float distance = HazardSprites[i].PathingSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;
                                    HazardSprites[i].pathingTravelled += MathHelper.ToRadians(distance);
                                    HazardSprites[i].Location = new Vector2(HazardSprites[i].pathingPoints[1].X + (float)(Math.Cos(HazardSprites[i].pathingTravelled) * HazardSprites[i].PathingRadiusX / 2f),
                                                            HazardSprites[i].pathingPoints[1].Y + (float)(Math.Sin(HazardSprites[i].pathingTravelled) * HazardSprites[i].PathingRadiusY / 2f));
                                    if (HazardSprites[i].pathingTravelled > 10f) HazardSprites[i].pathingTravelled -= MathHelper.ToRadians(360);
                                    if (HazardSprites[i].pathingTravelled < -10f) HazardSprites[i].pathingTravelled += MathHelper.ToRadians(360);
                                    HazardSprites[i].spriteBody.SetTransform(ConvertUnits.ToSimUnits(HazardSprites[i].SpriteCenterInWorld), HazardSprites[i].TotalRotation);

                                    //faces the correct direction of movement
                                    if (Math.Sin(HazardSprites[i].pathingTravelled) > 0) HazardSprites[i].IsFlippedHorizontally = true;
                                    else HazardSprites[i].IsFlippedHorizontally = false;
                                }

                                if (HazardSprites[i].IsHit) contactListener.ExplodeCreature(HazardSprites[i]);
                                break;
                                #endregion
                            }
                        case Sprite.Type.Switch:
                            {
                                AnimateSwitch(HazardSprites[i], gameTime, levelState);
                                break;
                            }
                        case Sprite.Type.Spring:
                            {
                                //deactivate animation if finished
                                if (HazardSprites[i].IsAnimated)
                                {
                                    if (HazardSprites[i].CurrentFrame == 0 && HazardSprites[i].IsAnimationDirectionForward == false)
                                    {
                                        HazardSprites[i].IsAnimated = false;
                                    }
                                }

                                //update color spring switchting
                                if (HazardSprites[i].TextureIndex >= 4) UpdateFadeAnimation(gameTime, HazardSprites[i]); //hit springs are for switches, fade them out or in, hit is out, not hit is in
                                break;
                            }
                        case Sprite.Type.Flame:
                        case Sprite.Type.FireballBlast:
                            {
                                if (HazardSprites[i].spriteBody.Enabled && HazardSprites[i].IsAwake)
                                {
                                    HazardSprites[i].Velocity += (int)(gameTime.ElapsedGameTime.Milliseconds);
                                    if (HazardSprites[i].Velocity > HazardSprites[i].HitPoints && HazardSprites[i].IsAnimated == false)
                                    {
                                        //turn flame on
                                        HazardSprites[i].IsAnimated = true;
                                        HazardSprites[i].CurrentFrame = 0;
                                        HazardSprites[i].Velocity = HazardSprites[i].HitPoints; //sync to effect
                                        HazardSprites[i].SpriteType = Sprite.Type.FireballBlast;

                                        //indefinately animated setup
                                        if (HazardSprites[i].HitPoints == 0)
                                        {
                                            HazardSprites[i].Velocity = int.MaxValue;
                                        }

                                    }
                                    if (HazardSprites[i].Velocity >= 2 * HazardSprites[i].HitPoints && HazardSprites[i].HitPoints != 0)
                                    {
                                        //turn flame off--code is in effect sprite to turn effect off
                                        HazardSprites[i].IsAnimated = false;
                                        HazardSprites[i].CurrentFrame = 4;
                                        HazardSprites[i].Velocity = 0f; //reset hp
                                        HazardSprites[i].SpriteType = Sprite.Type.Flame;
                                    }
                                }
                                break;
                            }
                        case Sprite.Type.Snowman:
                            {
                                if (HazardSprites[i].IsAnimated == true && HazardSprites[i].CurrentFrame == 0)
                                {
                                    //reset snowman if throw animation finished
                                    HazardSprites[i].IsAnimated = false;
                                    HazardSprites[i].CurrentFrame = 0;
                                    HazardSprites[i].AnimationFramePrecise = 0f;
                                    HazardSprites[i].Velocity = 0f;
                                }

                                HazardSprites[i].Velocity += (int)(gameTime.ElapsedGameTime.Milliseconds);
                                if (HazardSprites[i].Velocity > HazardSprites[i].HitPoints && HazardSprites[i].IsAnimated == false)
                                    {
                                        //throw snowball
                                        contactListener.ThrowSnowball(HazardSprites[i]);
                                        HazardSprites[i].IsAnimated = true;
                                        HazardSprites[i].CurrentFrame = 1;
                                        HazardSprites[i].AnimationFramePrecise = 1f;
                                    }
                                break;
                            }
                        case Sprite.Type.Beehive:
                            {
                                if (HazardSprites[i].IsHit) contactListener.ExplodeCreature(HazardSprites[i]);
                                break;
                            }
                        case Sprite.Type.Tower:
                            {
                                if (HazardSprites[i].TextureID == 10) //lights on tower block
                                {
                                    HazardSprites[i].HitPoints -= (int)(gameTime.ElapsedGameTime.Milliseconds);
                                    if (HazardSprites[i].HitPoints <= 0) HazardSprites[i].TextureID = 11;
                                }
                                //if (HazardSprites[i].TextureID == 11) //lights off tower block handled by updateTower

                                //if (HazardSprites[i].TextureID == 12) //excliaimation tower block
                                //{
                                //    HazardSprites[i].HitPoints -= (int)(gameTime.ElapsedGameTime.Milliseconds);
                                //    if (HazardSprites[i].HitPoints < 0)
                                //    {
                                //        if (LevelDataManager.rand.Next(0, 200) == 0) //fire TNT barrel
                                //        {
                                //            HazardSprites[i].HitPoints = 5000;
                                //            contactListener.DoCreateTNTBarrel(HazardSprites[i]);
                                //        }
                                //    }
                                //}
                                break;
                            }
                        default:
                            break;
                    }

                    //remove hazards that are hit, spring exempted
                    if (HazardSprites[i].IsHit)
                    {
                        if (HazardSprites[i].SpriteType != Sprite.Type.Spring) UpdateDeathAnimation(gameTime, HazardSprites[i]);
                    }
                }
            }
            return;
        }
Ejemplo n.º 53
0
 public Cutscene(ScreenManager screenManager, string dataAsset, GameplayScreen gameplayScreen)
     : base(screenManager, dataAsset)
 {
     IsDone         = false;
     GameplayScreen = gameplayScreen;
 }
Ejemplo n.º 54
0
        /// <inheritdoc />
        /// <summary>
        ///     Ctor
        /// </summary>
        /// <param name="screen"></param>
        public PauseScreen(GameplayScreen screen)
        {
            Screen = screen;

            // Background
            Background = new Sprite()
            {
                Parent = this,
                Size   = new ScalableVector2(WindowManager.Width, WindowManager.Height),
                Alpha  = 0,
                Image  = SkinManager.Skin.PauseBackground,
            };

            // Continue Button
            Continue = new ImageButton(SkinManager.Skin.PauseContinue, (o, e) =>
            {
                if (!Screen.IsPaused)
                {
                    return;
                }

                Screen.Pause();
            })
            {
                Parent    = this,
                Alignment = Alignment.MidLeft,
                Y         = -150,
                X         = -SkinManager.Skin.PauseContinue.Width,
                Alpha     = 1,
                UsePreviousSpriteBatchOptions = true
            };

            Continue.Size = new ScalableVector2(Continue.Image.Width, Continue.Image.Height);

            // Retry Button
            Retry = new ImageButton(SkinManager.Skin.PauseRetry, (o, e) =>
            {
                if (!Screen.IsPaused)
                {
                    return;
                }

                SkinManager.Skin.SoundRetry.CreateChannel().Play();
                QuaverScreenManager.ChangeScreen(new GameplayScreen(Screen.Map, Screen.MapHash, Screen.LocalScores));
            })
            {
                Parent    = this,
                Alignment = Alignment.MidLeft,
                Y         = 20,
                X         = -SkinManager.Skin.PauseRetry.Width,
                Alpha     = 1,
                UsePreviousSpriteBatchOptions = true
            };

            Retry.Size = new ScalableVector2(Retry.Image.Width, Retry.Image.Height);

            // Quit Button
            Quit = new ImageButton(SkinManager.Skin.PauseBack, (o, e) =>
            {
                if (!Screen.IsPaused)
                {
                    return;
                }

                Screen.IsPaused  = false;
                Screen.ForceFail = true;
                Screen.HasQuit   = true;

                // Make sure the screen transitioner isn't faded out at all
                var screenView = (GameplayScreenView)Screen.View;
                screenView.Transitioner.Alpha = 0;
            })
            {
                Parent    = this,
                Alignment = Alignment.MidLeft,
                Y         = 190,
                X         = -SkinManager.Skin.PauseBack.Width,
                Alpha     = 1,
                UsePreviousSpriteBatchOptions = true
            };

            Quit.Size = new ScalableVector2(Quit.Image.Width, Quit.Image.Height);
        }
Ejemplo n.º 55
0
        /// <summary>
        ///     Ctor -
        /// </summary>
        /// <param name="screen"></param>
        internal SongInformation(GameplayScreen screen)
        {
            Screen = screen;

            Size  = new ScalableVector2(750, 150);
            Tint  = Colors.MainAccentInactive;
            Alpha = 0;

            // Create watching text outside of replay mode because other text relies on it.
            Watching = new SpriteText(Fonts.SourceSansProSemiBold, $"Watching {(screen.InReplayMode ? Screen.LoadedReplay.PlayerName : "")}", 13)
            {
                Parent    = this,
                Alignment = Alignment.TopCenter,
                Y         = 25,
                Alpha     = 0
            };

            Title = new SpriteText(Fonts.SourceSansProSemiBold, $"{Screen.Map.Artist} - {Screen.Map.Title}", 13)
            {
                Parent    = this,
                Alignment = Alignment.TopCenter,
                Y         = Watching.Y + TextYSpacing + TextYSpacing,
                Alpha     = 0,
            };

            Difficulty = new SpriteText(Fonts.SourceSansProSemiBold, $"[{Screen.Map.DifficultyName}]", 13)
            {
                Parent    = this,
                Alignment = Alignment.TopCenter,
                Y         = Title.Y + TextYSpacing + TextYSpacing * 0.85f,
                Alpha     = 0
            };

            Creator = new SpriteText(Fonts.SourceSansProSemiBold, $"Mapped By: \"{Screen.Map.Creator}\"", 13)
            {
                Parent    = this,
                Alignment = Alignment.TopCenter,
                Y         = Difficulty.Y + TextYSpacing + TextYSpacing * 0.80f,
                Alpha     = 0
            };

            var difficulty = (float)MapManager.Selected.Value.DifficultyFromMods(ModManager.Mods);

            Rating = new SpriteText(Fonts.SourceSansProSemiBold,
                                    $"Difficulty: {StringHelper.AccuracyToString(difficulty).Replace("%", "")}",
                                    13)
            {
                Parent    = this,
                Alignment = Alignment.TopCenter,
                Y         = Creator.Y + TextYSpacing + TextYSpacing * 0.75f,
                Alpha     = 0,
                Tint      = ColorHelper.DifficultyToColor(difficulty)
            };

            // Get a formatted string of the activated mods.
            var modsString = "Mods: " + (ModManager.CurrentModifiersList.Count > 0 ? $"{ModHelper.GetModsString(ModManager.Mods)}" : "None");

            Mods = new SpriteText(Fonts.SourceSansProSemiBold, modsString, 13)
            {
                Parent    = this,
                Alignment = Alignment.TopCenter,
                Y         = Rating.Y + TextYSpacing + TextYSpacing * 0.7f,
                Alpha     = 0
            };
        }
Ejemplo n.º 56
0
 public SayHandler(GameplayScreen gameplayScreen) : base(new SayHandlerCommands(gameplayScreen))
 {
     GameplayScreen = gameplayScreen;
 }
Ejemplo n.º 57
0
        public GameplayScreen(String filename)
        {
            TransitionOnTime = TimeSpan.FromSeconds(1.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);

            pauseAction = new InputAction(
                new Buttons[] { Buttons.Start, Buttons.Back },
                new Keys[] { Keys.Escape },
                true);

            currentGame = this;
            loadFromFile = true;
            customFilename = filename;
        }
Ejemplo n.º 58
0
 public Level4EndCutScene(ScreenManager screenManager, string dataAsset, GameplayScreen gameplayScreen)
     : base(screenManager, dataAsset, gameplayScreen)
 {
 }
Ejemplo n.º 59
0
 public Alien(GameplayScreen screen, Vector2 pkaardiAsukoht, MoveDirection initialDirection)
     : base(screen, pkaardiAsukoht, "blueslime", 1, 50)
 {
     setDirection(initialDirection);
 }
Ejemplo n.º 60
0
 /// <summary>
 /// Creates a new component instance.
 /// </summary>
 /// <param name="game">Associated game object.</param>
 /// <param name="gameScreen">Game screen where the component will be presented.</param>
 /// <param name="texture">Texture asset which represents the component.</param>
 /// <param name="position">Position where the component should be drawn.</param>
 public StaticTextureComponent(Game game, GameplayScreen gameScreen, Texture2D texture, Vector2 position)
     : base(game, gameScreen, texture)
 {
     Position = position;
 }