Beispiel #1
0
 public override void loadContent()
 {
     base.loadContent();
     m_bling = new ImageManager("Images//Prop//Consumables//Sparkle");
     m_bling.setAnimationSpeed(18);
     m_collectSound = new Sound("Game/Tagrej");
 }
Beispiel #2
0
 public override void loadContent()
 {
     base.loadContent();
     if (m_pairedVentilationId != 0 && m_pairedVentilation == null)
     {
         m_pairedVentilation = (VentilationDrum)Game.getInstance().getState().getObjectById(m_pairedVentilationId);
     }
     m_backImg = new ImageManager("Images//Tile//Ventilation//Straight//aventil_short_tile_w_floor");
     m_collisionShape = new CollisionRectangle(30, 30, 42, 12, m_position);
     if (s_unlockSound == null)
     {
         s_unlockSound = new Sound("Game//ledgegrab");
     }
 }
Beispiel #3
0
 public override void loadContent()
 {
     base.loadContent();
     m_connectedSpotLights = new LinkedList<SpotLight>();
     if (m_connectedSpotLightsId == null)
     {
         m_connectedSpotLightsId = new LinkedList<int>();
     }
     for (int i = 0; i < m_connectedSpotLightsId.Count(); i++)
     {
         try //TODO debug
         {
             m_connectedSpotLights.AddLast((SpotLight)Game.getInstance().getState().getObjectById(m_connectedSpotLightsId.ElementAt(i)));
         }
         catch (InvalidCastException)
         {
             m_connectedSpotLightsId.Remove(m_connectedSpotLightsId.ElementAt(i));
         }
     }
     m_collisionShape = new CollisionRectangle(28, 25, 45 - 28, 30, m_position);
     m_switchSound = new Sound("Game//lightbutton");
 }
Beispiel #4
0
        public override void loadContent()
        {
            base.loadContent();
            m_collisionShape = new CollisionRectangle(10, 10, m_img.getSize().X - 20, m_img.getSize().Y - 10, m_position);
            m_lampSwitchTargets = new LinkedList<LampSwitch>();
            if (m_flashLightId > 0)
            {
                m_flashLight = ((FlashCone)(Game.getInstance().getState().getObjectById(m_flashLightId)));
                m_flashLight.getPosition().setParentPosition(this.getPosition());
            }
            if (m_lampSwitchTargetsId == null)
            {
                m_lampSwitchTargetsId = new LinkedList<int>();
            }
            foreach (int t_lsti in m_lampSwitchTargetsId)
            {
                m_lampSwitchTargets.AddLast((LampSwitch)Game.getInstance().getState().getObjectById(t_lsti));
            }
            m_facingRight = m_spriteEffects == SpriteEffects.None;
            m_huhSound = new Sound("Game//104696__grunz__grunz-huh");
            m_huhSound.setVolume(7);

            #region Texture Loading
            t2d_run				= Game.getInstance().Content.Load<Texture2D>("Images//Sprite//Guard//guard_run");
            t2d_walk			= Game.getInstance().Content.Load<Texture2D>("Images//Sprite//Guard//guard_walk");
            t2d_flashWalk		= Game.getInstance().Content.Load<Texture2D>("Images//Sprite//Guard//guard_flash_walk");
            t2d_flashIdle		= Game.getInstance().Content.Load<Texture2D>("Images//Sprite//Guard//guard_flash_idle");
            t2d_flashTurn		= Game.getInstance().Content.Load<Texture2D>("Images//Sprite//Guard//guard_flash_turn");
            t2d_idle			= Game.getInstance().Content.Load<Texture2D>("Images//Sprite//Guard//guard_idle");
            t2d_pickUpFlash		= Game.getInstance().Content.Load<Texture2D>("Images//Sprite//Guard//guard_pick_up_flash");
            t2d_putDownFlash	= Game.getInstance().Content.Load<Texture2D>("Images//Sprite//Guard//guard_put_down_flash");
            t2d_strike			= Game.getInstance().Content.Load<Texture2D>("Images//Sprite//Guard//guard_strike");
            t2d_turn			= Game.getInstance().Content.Load<Texture2D>("Images//Sprite//Guard//guard_turn");
            t2d_qmark			= Game.getInstance().Content.Load<Texture2D>("Images//Sprite//Guard//qmark");
            t2d_emark			= Game.getInstance().Content.Load<Texture2D>("Images//Sprite//Guard//Exclmarks");
            #endregion
            if (m_img.isTexture(t2d_flashTurn) || m_img.isTexture(t2d_turn) || m_img.isTexture(t2d_pickUpFlash) || m_img.isTexture(t2d_putDownFlash))
            {
                m_img.setLooping(false);
            }
            if (m_img.isTexture(t2d_walk) || m_img.isTexture(t2d_flashWalk))
            {
                m_img.setAnimationSpeed(WALKINGANIMATIONSPEED);
            }
        }
Beispiel #5
0
        public override void loadContent()
        {
            base.loadContent();
            if (!(Game.getInstance().getState() is DevelopmentState))
            {
                addHearts();
            }

            string[] t_heroSprites = Directory.GetFiles("Content//Images//Sprite//Hero//");
            foreach (string t_file in t_heroSprites)
            {
                string[] t_splitFile = Regex.Split(t_file, "//");
                string[] t_extless = t_splitFile[t_splitFile.Length - 1].Split('.');
                if (t_extless[1].Equals("xnb"))
                {
                    Game.getInstance().Content.Load<Texture2D>("Images//Sprite//Hero//" + t_extless[0]);
                }
            }

            m_img = new ImageManager("Images//Sprite//Hero//hero_stand");

            m_interactionArrow = new GameObject(new CartesianCoordinate(new Vector2(15, -70), m_position), "Images//GUI//GameGUI//interaction", m_layer - 0.1f, m_listLayer);
            setInteractionVisibility(false);
            m_interactionArrow.getImg().setAnimationSpeed(20f);
            m_standHitBox	= new CollisionRectangle(0, 0, 70, 127, m_position);
            m_rollHitBox	= new CollisionRectangle(0, 0, 70, 72, m_position);
            m_slideBox		= new CollisionRectangle(0, m_standHitBox.getOutBox().Height / 2, m_standHitBox.getOutBox().Width, 1, m_position);
            m_hangHitBox	= new CollisionRectangle(0, 0, 70, 80, m_position);
            m_swingHitBox	= new CollisionRectangle(-36, 0, 70, 127, m_position);
            m_collisionShape = m_standHitBox;
            m_ventilationDirection	= new List<Direction>();
            m_upDownList			= new List<Direction>();
            m_leftRightList			= new List<Direction>();
            m_noneList				= new List<Direction>();
            m_lastVentilationDirection = Direction.None;
            m_upDownList.Add(Direction.Up);
            m_upDownList.Add(Direction.Down);
            m_leftRightList.Add(Direction.Left);
            m_leftRightList.Add(Direction.Right);
            m_noneList.Add(Direction.None);
            m_playerCurrentSpeed = PLAYERSPEED;
            m_swingSpeed = 0;
            m_slideTimer = 0;
            m_currentVentilationImage = VENTIDLEIMAGE;
            m_currentSwingingImage = "hero_swing_still";
            m_position.plusYWith(-1);
            m_facingRight = true;

            m_hitSound1 = new Sound("Game//FirstHit");
            m_hitSound2 = new Sound("Game//SecHit");
            m_hitSound3 = new Sound("Game//LethalHit");
            m_jumpSound = new Sound("Game//hopp");
            m_landSound = new Sound("Game//landa2");
            m_landSound.setVolume(10);
            m_slideSound = new Sound("Game//32584__redjim__fabric-rustling");
            m_slideSound.setLooping(true);
            m_hangSound = new Sound("Game/ledgegrab");
            m_stepSound = new Sound("Game//walk");
            m_runSound = new Sound("Game//walk4");
            m_hideSound = new Sound("Game//hopp");
            m_ventilationMoveSound = new Sound("Game//ledgegrab");
            m_ladderSound = new Sound("Game//ledgegrab");
            m_rollSound = new Sound("Game//hopp");
            m_ledgeClimbSound = new Sound("Game//tygklatter");
            m_windowActionSound = new Sound("Game//tygklatter2");

            m_img.m_animationEvent += new ImageManager.animationDelegate(changedSubImage);
        }