Beispiel #1
0
        public override void update(GameTime gameTime, Floor floor)
        {
            if (done || measureDis(floor.Character) < 220)
            {
                done = true;
                Open = false;
                return;
            }


            base.update(gameTime, floor);

            time += (float)gameTime.ElapsedGameTime.TotalSeconds;
            if (time >= 1f)
            {
                Open = !Open;
                time = 0;
                SoundComponent.playEffect(Sound.DoorOpening, .25f);
            }
        }
Beispiel #2
0
        public virtual void update(GameTime gameTime, Floor floor)
        {
            base.update(gameTime);

            //Check if play near by
            if (this == floor.Character.Focus)
            {
                this.color = new Color(185, 185, 185);
                hasFocus(floor);

                //Play sound
                if (Input.actionBarPressed() && sound != null)
                {
                    SoundComponent.playEffect(sound);
                }
            }
            else
            {
                this.color = Color.White;
            }
        }