Пример #1
0
 public MainViewModel()
 {
     CvInvoke.UseOpenCL = false;
     _playerState = PlayerStates.Stopped;
     _stopwatch = new Stopwatch();
     _baseFileAccessor = new VideoCloudPointsFileAccessor();
 }
 void OnMarioShrinkFinish()
 {
     PauseAllAnimations = false;
     PlayerState        = PlayerStates.Small;
     TransformMarioToNewSize();
     UnpauseMario();
     PauseControl = false;
     theLevelManager.invincible = true;
 }
Пример #3
0
 void Start()
 {
     isClimbing   = false;
     climbSpeed   = 0;
     controller   = GetComponent <Controller2D>();
     gravity      = -(2 * jumpHeight) / Mathf.Pow(timeToJumpApex, 2);
     jumpVelocity = Mathf.Abs(gravity) * timeToJumpApex;
     playerState  = PlayerStates.grounded;
 }
Пример #4
0
    public void Spawn(GameObject player)
    {
        playerState = player.GetComponent <PlayerStates>();

        SetPosition(ref player);
        powderStates.currentState = GunpowderStates.PowderState.Held;
        playerState.playerState   = PlayerStates.PlayerState.pGunpowder;
        PickedUpComponents(ref playerState, rb, this.gameObject);
    }
Пример #5
0
    private void PlayerStateDataOnStateExit(PlayerStates state)
    {
        if (state != PlayerStates.EXTRACTING)
        {
            return;
        }

        lineRenderer.enabled = false;
    }
Пример #6
0
 protected void ChangeState(PlayerStates State)
 {
     if (!StateEquals(State))
     {
         currentAnimation.frames       = animations[State].Key;
         currentAnimation.goalTime     = animations[State].Value;
         currentAnimation.currentFrame = 0;
         playerState = State;
     }
 }
Пример #7
0
 void Refill(GameObject col)
 {
     playerState = col.GetComponent <PlayerStates>();
     if (playerState.FuelInJetpack <= 0)
     {
         playerState.FuelInJetpack = playerState.FuelInJetpackMax;
         HideObject();
         Invoke("UnhideObject", reactivateTime);
     }
 }
Пример #8
0
    // Called when the local player clicks on the 'lock in' button
    void LockChampion()
    {
        playerState               = PlayerStates.lockedIn;
        titleText.text            = LocalisationManager.instance.GetValue("champ_select_title_waiting");
        lockinButton.interactable = false;
        lockedIn = true;
        Transform container = GetLocalPlayerContainer();

        container.GetComponent <ChampionLock>().LockIn(selectedChampion);
    }
Пример #9
0
	// Use this for initialization
	void Start () {
		//Assign the players rigidbody.
		r = this.GetComponent<Rigidbody> ();
		if (lockCursor) {
			Cursor.lockState = CursorLockMode.Locked;
			Cursor.visible = false;
		}
		//get easy, readable reference to playerstates.
		p = PlayerStates.instance;
	}
Пример #10
0
 private void Jump()
 {
     anim.SetBool("midair", true);
     anim.SetBool("climbing", false);
     anim.SetBool("hanging", false);
     state = PlayerStates.None;
     didSomethingDurningFrame = true;
     ReleaseDraggedObject();
     currentVelocity.y = jumpForce;
 }
Пример #11
0
    void Start()
    {
        _states = player.GetComponent <PlayerStates>();

        Vector3 newPos = playerShip.transform.position;

        newPos.z = transform.position.z;

        transform.position = newPos;
    }
    private void CompleteAction(PlayerStates player)
    {
        player.playerState = PlayerStates.PlayerState.pEmpty;
        GameObject interactable = player.GetComponentInChildren <InteractableObjs>().gameObject;

        player.itemHeld.SetActive(false);
        player.itemHeld = null;
        RotateShoulders(player.transform.GetChild(0).GetChild(0), player);
        interactable.SetActive(false);
    }
Пример #13
0
    private void GetBig()
    {
        playerState = PlayerStates.grow;

        transform.localScale   = bigSize;
        playerController.speed = bigSpeed;

        Debug.Log("Player growing");
        Debug.Log("Max HP ++");
    }
Пример #14
0
 public void BeginPlay()
 {
     myCurrentState = PlayerStates.PLAYING;
     SetCurrentFunds(_runStartFunds * GetLevel());
     pc.Propel(initialForce);
     audioSource.clip = launch;
     audioSource.Play();
     handleInput = true;
     CoroutineManager.BeginCoroutine(CheckAchievementsRoutine(), ref cr_AchievementChecker, this);
 }
Пример #15
0
 public void CastArcaneBolt()
 {
     this.PlayerState = PlayerStates.Attack;
     if (CurrentManaPool >= 8f)
     {
         this.GetComponent <ArcaneBoltSpawner>().SpawnTheObject(this.gameObject);
         CastSpell(8f);
     }
     //This should pass through the reference of ArcaneBolt set in SpawnedObject to the SetupSpawnObject function
 }
Пример #16
0
 // Use this for initialization
 void Start()
 {
     instance = this;
     onNewGameStart();
     currentState    = PlayerStates.CheckMatch;
     audioController = GameObject.Find("AudioController").GetComponent <AudioController> ();
     gameManager     = GameObject.Find("GameManager").GetComponent <GameManager> ();
     comboCount      = 0;
     //checkForMatch ();
 }
    public void WasHit(Vector3 enemyPos)
    {
        if (playerCurrentState != PlayerStates.Dead && playerCurrentState != PlayerStates.Hit && playerCurrentState != PlayerStates.None && Time.timeSinceLevelLoad >= hitTime + stunTime + immunityTime)
        {
            playerCurrentState = PlayerStates.Hit;
            hittingMonster     = enemyPos;
        }

        Debug.Log("Was hit!");
    }
Пример #18
0
 private void Awake()
 {
     player = ReInput.players.GetPlayer(playerId);
     m_SpeedFactor.SetValue(m_RunSpeed.Value);
     refSpeed          = m_SpeedFactor.Value;
     m_PlayerStates    = GetComponent <PlayerStates> ();
     layerMask         = LayerMask.GetMask("Ground");
     cController       = GetComponent <CharacterController> ();
     m_PlayerAnimation = GetComponent <PlayerAnimation> ();
 }
Пример #19
0
    //-----------------------------------

    void Start()
    {
        timeManager = GameObject.FindGameObjectWithTag("GamePlayHandler").GetComponent <TimeManager>();

        player = transform.root.gameObject; // Gets the root ref

        reflectFXParticle = reflectFX.GetComponent <ParticleSystem>();

        playerState = this.GetComponentInParent <PlayerStates>();
    }
Пример #20
0
 void Start()
 {
     m_iTurretsPlaced       = 0;
     m_iCurrentlyPlacing    = 0;
     m_goCurrentlyPlacing   = m_goPossibleTurrets[0];
     m_ePlayerState         = PlayerStates.DEFAULT;
     m_iMaxTurretsPlaceable = 50;
     m_goPlacedTurrets      = new GameObject[m_iMaxTurretsPlaceable];
     m_goPlacementDefault   = m_goTurretPlacementOk[m_iCurrentlyPlacing];
 }
Пример #21
0
 private void BtnStop_Click(object sender, EventArgs e)
 {
     player.controls.stop();
     btnPlay.BackgroundImage = Properties.Resources.play2;
     Paused              = true;
     lblMediaName.Text   = STOPPED;
     tmrPlayTick.Enabled = false;
     txtCurrentTime.Text = ZERO_TIME;
     State = PlayerStates.Stopped;
 }
Пример #22
0
    private void Start()
    {
        playerStates = GetComponent <PlayerStates>();
        rb           = GetComponent <Rigidbody>();

        speed = baseSpeed;

        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;
    }
Пример #23
0
    public void GetHit(Vector3 attackPosition)
    {
        PlayerStates playerStates = GetComponent <PlayerStates>();

        if (playerStates.isAlive)
        {
            GetComponent <PlayerStates>().TakeDamage();
            //HitEffect
        }
    }
Пример #24
0
 // Start is called before the first frame update
 void Start()
 {
     _spriteRenderer   = GetComponent <SpriteRenderer>();
     _state            = GetComponentInParent <PlayerStates>();
     _spriteHeight     = _spriteRenderer.bounds.size.y;
     _spriteWidth      = _spriteRenderer.bounds.size.x;
     _resourceLayer    = LayerMask.GetMask("resource");
     _animText         = collectText.GetComponent <TextMeshProUGUI>();
     _animTextAnimator = collectText.GetComponent <Animator>();
 }
Пример #25
0
 void DropObject()
 {
     if (carriedObject != null)
     {
         carriedObject.GetComponent <PickUp>().state = PickUp.PickUpStates.CanPickUp;
         carriedObject.transform.parent = null;
         carriedObject = null;
         state         = PlayerStates.Normal;
     }
 }
Пример #26
0
 public void Initialize()
 {
     CurrentSpeed       = InitialSpeed;
     transform.position = _originalPosition;
     _state             = PlayerStates.OnGround;
     if (_weapon != null)
     {
         _weapon.Initialize();
     }
 }
Пример #27
0
    IEnumerator CharacterBehaviour()
    {
        while (states != PlayerStates.dead)
        {
            dpad = VCDPadBase.GetInstance("dpad");
            if (isBoss && !lifeBar)
            {
                lifeBar        = GameObject.Find("BossLifeFill").GetComponent <tk2dSlicedSprite>();
                actorName      = GameObject.Find("BossName").GetComponent <tk2dTextMesh>();
                actorName.text = characterName;
                actorName.Commit();
            }
            LifeBarStatus();
            if (isPlayer)
            {
                switch (states)
                {
                case PlayerStates.idle: Idle(dpad); break;

                case PlayerStates.walk: Walk(dpad); break;

                case PlayerStates.jump: Jumping(false); break;

                case PlayerStates.grab:
                    if (grabbedZone.childCount == 0)
                    {
                        player.Play("Idle");
                        states = PlayerStates.idle;
                    }
                    break;

                case PlayerStates.jumpattack: Jumping(true); break;

                case PlayerStates.ko: KO(koOthers); break;
                }
            }
            else
            {
                switch (states)
                {
                case PlayerStates.idle: Idle(playerPos); break;

                case PlayerStates.walk: Walk(playerPos); break;

                case PlayerStates.jump: Jumping(false); break;

                case PlayerStates.jumpattack: Jumping(true); break;

                case PlayerStates.ko: KO(koOthers); break;
                }
            }
            yield return(null);
        }
        StartCoroutine("Dead");
    }
Пример #28
0
    void StateBasicMovement()
    {
        if (Input.GetKey(KeyCode.W) && footSteps.isPlaying == false)
        {
            footSteps.Play();
        }
        if (Input.GetKey(KeyCode.A) && footSteps.isPlaying == false)
        {
            footSteps.Play();
        }
        if (Input.GetKey(KeyCode.S) && footSteps.isPlaying == false)
        {
            footSteps.Play();
        }
        if (Input.GetKey(KeyCode.D) && footSteps.isPlaying == false)
        {
            footSteps.Play();
        }
        //Debug.Log (playerController.isGrounded);
        if (zeroGravity == true)
        {
            curState = PlayerStates.jetPack;
        }
        // check to see if the isOnPlatform is Checked
        if (isOnPlatform == true)
        {
            curState = PlayerStates.idle;
        }


        if (Input.GetKeyUp(KeyCode.W))
        {
            footSteps.Stop();
            curState = PlayerStates.idle;
        }
        if (Input.GetKeyUp(KeyCode.S))
        {
            footSteps.Stop();
            curState = PlayerStates.idle;
        }
        if (Input.GetKeyUp(KeyCode.D))
        {
            footSteps.Stop();
            curState = PlayerStates.idle;
        }
        if (Input.GetKeyUp(KeyCode.A))
        {
            footSteps.Stop();
            curState = PlayerStates.idle;
        }
        if (canClimb == true && Input.GetKeyDown(KeyCode.E))
        {
            curState = PlayerStates.climbing;
        }
    }
Пример #29
0
	public void AlterResources()
	{
		PlayerStates states = new PlayerStates ();
		int originalResources = states.resources;
		states.alterResources (-10);
		int newResources = states.resources;
		Assert.Less (newResources, originalResources);
		states.alterResources (10);
		Assert.AreEqual (states.resources, originalResources);

	}
Пример #30
0
    public void ChangePlayerState(PlayerStates state)
    {
        if (_player == null)
        {
            return;
        }

        var playerState = _stateFactory.CreateState(state);

        _player.ChangeState(playerState);
    }
Пример #31
0
 public void ChangeState(PlayerStates state)
 {
     if (_state != null)
     {
         _state.Dispose();
         _state = null;
     }
     Debug.Log("Changing to player state : " + state.ToString());
     _state = _stateFactory.CreateState(state);
     _state.Start();
 }
Пример #32
0
    public void ChangeState(PlayerStates state)
    {
        if (_state != null)
        {
            _state.Dispose();
            _state = null;
        }

        _state = _stateFactory.CreateState(state);
        _state.Start();
    }
Пример #33
0
 private void Jump()
 {
     if (IsPlayerOnGround && _landed)
     {
         PlayerStates.UnSet(PlayerStates.AnimationParameter.Running);
         PlayerStates.Set(PlayerStates.AnimationParameter.Jump);
         PlayerStates.Set(PlayerStates.AnimationParameter.Jumping);
         Vector2 jumpVelocityVector = new Vector2(0, PhysicsHelper.GetVelocityToReachHeight(_jumpHeight));
         _rigidBody.velocity = jumpVelocityVector;
     }
 }
Пример #34
0
 public Player()
 {
     Position = new Vector2();
     State = PlayerStates.Running;
     runAnimation = new SpriteAnimation();
     jumpAnimation = new SpriteAnimation();
     slidingAnimation = new SpriteAnimation();
     swordAnimation = new SpriteAnimation();
     dieAnimation = new SpriteAnimation();
     punchAnimation = new SpriteAnimation();
     immunity = 100;
     scale = 1f;
     speedX = 0;
 }
Пример #35
0
    public bool validateNewAction(PlayerActions newAction)
    {
        FSMState result = getCurrentState();

        PlayerStates newState = result.validateNewAction(newAction);

        if(newState.Equals(PlayerStates.NULL))
        {
            return false;
        }
        else
        {
            currentState=newState;
            return true;
        }
    }
Пример #36
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag.Contains ("Wall")) {
         //player hit wall
         switch (state) {
         case PlayerStates.MovingLeft:
             if (other.Equals (LeftWall))
                 state = PlayerStates.StopedLeft;
             break;
         case PlayerStates.MovingRight:
             if (other.Equals (RightWall))
                 state = PlayerStates.StopedRight;
             break;
         }
     } else if (other.tag.Contains ("ScoreLine")) {
         gameController.IncrementScore();
     } else if (other.tag.Contains ("Obsticle")){
         // Player hit obsticles
         GameController.paused = true;
     }
 }
Пример #37
0
 public void PlayerPickedUpByIcydactyl(object icydactylObj)
 {
     AttachedTo = (ActiveObject)icydactylObj;
       State = PlayerStates.Carried;
 }
Пример #38
0
 void SetOnFire()
 {
     Velocity.X = PLAYER_SPEED * 2;
       LastOnFire = Game1.CurrentTime;
       State = PlayerStates.OnFire;
 }
Пример #39
0
 void KnockBackInDirection(int dir, float strength)
 {
     Velocity.X = dir * KNOCKBACK_SPEED * strength;
       Velocity.Y = -KNOCKBACK_SPEED / 2 * strength;
       State = PlayerStates.KnockBack;
 }
Пример #40
0
 public void SwarmPlayer(object swarmObj)
 {
     if (State == PlayerStates.Standing
     || State == PlayerStates.Walking
     || State == PlayerStates.Shooting)
       {
     State = PlayerStates.Swarmed;
     ShakeCount = MAX_SHAKES_TILL_RELEASE;
     Velocity = Vector2.Zero;
       }
 }
Пример #41
0
        public bool ShootAtObject(ActiveObject obj)
        {
            if (!obj.CanBeShot)
            return false;

              // Check distance
              float distance = obj.DrawBox.Center.Distance(DrawBox.Center);

              if (distance < ShootRange)
              {
            if (State == PlayerStates.Walking)
              Stop();

            if (State == PlayerStates.Standing || State == PlayerStates.Shooting)
            {
              ShootTarget = obj;
              State = PlayerStates.Shooting;
              Game1.EventMan.Notify(Events.PlayerShootsObj, new ActiveObject[] { this, obj });
              return true;
            }
              }

              return false;
        }
Пример #42
0
 public void PlayerHitByRockguy(object rockguyObj)
 {
     if (State == PlayerStates.Standing
     || State == PlayerStates.Walking
     || State == PlayerStates.Shooting)
       {
     // Knockback
     Rockguy rockguy = (Rockguy)rockguyObj;
     State = PlayerStates.KnockBack;
     Velocity.X = KNOCKBACK_SPEED * rockguy.Direction * 2;
     HPDown(rockguy.DAMAGE);
       }
 }
Пример #43
0
        public void PlayerHitByPlant(object snappingPlanetObj)
        {
            if (State == PlayerStates.Standing
            || State == PlayerStates.Walking
            || State == PlayerStates.Shooting)
              {
            // Knockback
            State = PlayerStates.KnockBack;
            Velocity.X = KNOCKBACK_SPEED * 0.25f * -Direction;

            //HPDown(1);
              }
        }
Пример #44
0
        public void PlayerFlattened(object boombaObj)
        {
            // PlayerFlattened
              if (State == PlayerStates.Standing
            || State == PlayerStates.Walking
            || State == PlayerStates.Shooting)
              {
            State = PlayerStates.Flattened;
            Velocity = Vector2.Zero;
            LastFlattened = Game1.CurrentTime;

            HPDown(FLATTENED_DAMAGE);
              }
        }
Пример #45
0
 public void MoveTo(Vector2 target)
 {
     if (State == PlayerStates.Standing
     || State == PlayerStates.Walking
     || State == PlayerStates.Shooting)
       {
     TargetDestination = target;
     State = PlayerStates.Walking;
     Audio.Play(SFX.Walking);
       }
 }
Пример #46
0
 void Awake()
 {
     playerStates = GameObject.FindWithTag("Player").GetComponent<PlayerStates>();
 }
Пример #47
0
 public void PlayerReleasedByIcydactyl(object nothing)
 {
     State = PlayerStates.Standing;
 }
Пример #48
0
        public void PlayerHitIceColumn(object iceColumnObj)
        {
            IceColumn iceColumn = (IceColumn)iceColumnObj;

              if (State == PlayerStates.Standing
            || State == PlayerStates.Walking
            || State == PlayerStates.Shooting)
              {
            float bounceSpeedX = KNOCKBACK_SPEED;

            if (DrawBox.Center.X < iceColumn.DrawBox.Center.X)
            {
              // Bounce left and freeze
              bounceSpeedX *= -1;
            }

            Velocity.X = bounceSpeedX;
            Velocity.Y = -KNOCKBACK_SPEED * 0.2f;
            Position.Y -= 20;
            State = PlayerStates.Frozen;

            LastFrozen = Game1.CurrentTime;
              }
        }
Пример #49
0
        public void Shake(object nothing)
        {
            if (State == PlayerStates.Swarmed)
              {
            if (--ShakeCount <= 0)
            {
              ShakeCount = 0;

              if (State == PlayerStates.Swarmed)
              {
            State = PlayerStates.Standing;
            Game1.EventMan.Notify(Events.ShakeReleased, this);
              }
            }
              }
        }
Пример #50
0
        public void PlayerHitSpikes(object spikes)
        {
            SpikeWall spikeWall = (SpikeWall)spikes;

              if (State == PlayerStates.Standing
            || State == PlayerStates.Walking
            || State == PlayerStates.Shooting
            || State == PlayerStates.KnockBack)
              {
            // Resolve Collision
            Rectangle overlap = Rectangle.Intersect(spikeWall.Hitbox, Hitbox);

            if (DrawBox.Center.X > spikeWall.DrawBox.Center.X)
              Position.X += overlap.Width;
            else
              Position.X -= overlap.Width;

            // Knockback
            State = PlayerStates.KnockBack;
            Velocity.X = KNOCKBACK_SPEED * 0.25f * -Direction;

            HPDown(spikeWall.DAMAGE);
              }
        }
Пример #51
0
 public void StopShooting()
 {
     if (State == PlayerStates.Shooting)
       {
     State = PlayerStates.Standing;
     LastShotAtSomething = Game1.CurrentTime;
       }
 }
Пример #52
0
        public void PlayerHitWithIcicle(object icicleObj)
        {
            if (State == PlayerStates.Standing
            || State == PlayerStates.Walking
            || State == PlayerStates.Shooting)
              {
            // Knockback
            State = PlayerStates.KnockBack;
            Velocity.X = KNOCKBACK_SPEED * 0.25f * -Direction;

            IceCloud.Icicle icicle = (IceCloud.Icicle)icicleObj;
            HPDown(icicle.DAMAGE);
              }
        }
Пример #53
0
        public override void Update(GameTime gameTime)
        {
            float timeDelta = (float)gameTime.ElapsedGameTime.TotalSeconds;

              switch (State)
              {
            case PlayerStates.Standing:
              Velocity.X = 0;
              break;

            case PlayerStates.Walking:
              EvaluateWalking(timeDelta);
              break;

            case PlayerStates.Shooting:
              EvaluateShooting();
              break;

            case PlayerStates.KnockBack:
              Velocity.X *= 0.90f; // Horizontal Friction

              if (Math.Abs(Velocity.X) < KNOCKBACK_SPEED * timeDelta)
            RestorePlayerState(true);
              break;
            case PlayerStates.Electrocuted:
              if (gameTime.TotalGameTime - LastElectrocuted > ElectrocutionDuration)
            State = PlayerStates.Standing;
              break;
            case PlayerStates.Hugged:
              Velocity = Vector2.Zero;
              HPDown(Yeti.HUGGING_DAMAGE);
              break;
            case PlayerStates.Carried:
              Velocity = Vector2.Zero;
              Position = new Vector2(
            AttachedTo.DrawBox.X,
            AttachedTo.DrawBox.Center.Y - 50);
              break;
            case PlayerStates.Frozen:
              if (Game1.CurrentTime - LastFrozen > FreezeRate)
            RestorePlayerState(false);

              Velocity.X *= 0.95f;
              break;
            case PlayerStates.Flattened:
              if (Game1.CurrentTime - LastFlattened > FlattenedCoolDown)
            RestorePlayerState(false);
              break;
            case PlayerStates.OnFire:
              // Don't change direction intially
              if (Game1.CurrentTime - LastOnFireDirectionChange > OnFireFirstDirectionChangeRate)
              {
            if (Game1.CurrentTime - LastOnFireDirectionChange > OnFireDirectionChangeRate)
            {
              LastOnFireDirectionChange = Game1.CurrentTime;
              Velocity.X = -Velocity.X;
            }
              }

              HPDown(FIRE_DAMAGE);

              if (Game1.CurrentTime - LastOnFire > OnFireDuration)
            RestorePlayerState(false);
              break;
              }

              // Facing Direction, if 0, leave as is
              if (Velocity.X > 0)
            Direction = 1;
              else if (Velocity.X < 0)
            Direction = -1;

              // Stop from falling through the ground
              if (DrawBox.Bottom > World.GroundLevel)
            Velocity.Y = 0;

              // Move
              Position.X += Velocity.X * timeDelta;
              Position.Y += Velocity.Y * timeDelta;

              UpdateDrawbox();

              if (DrawBox.Center.X < 0)
              {
            int difference = 0 - DrawBox.Center.X;
            Position.X = World.WORLD_WIDTH - DrawBox.Width / 2 - difference;
              }

              if (DrawBox.Center.X > World.WORLD_WIDTH)
              {
            int difference = World.WORLD_WIDTH - DrawBox.Center.X;

            Position.X = DrawBox.Width / 2 - difference;
            UpdateDrawbox();
              }
        }
Пример #54
0
        public void PlayerHitWithLightning(object lightningObj)
        {
            if (State == PlayerStates.Walking
            || State == PlayerStates.Standing
            || State == PlayerStates.Shooting)
              {
            State = PlayerStates.Electrocuted;
            LastElectrocuted = Game1.CurrentTime;
            Velocity = Vector2.Zero;

            StormCloud.Lightning lightning = (StormCloud.Lightning)lightningObj;
            HPDown(lightning.DAMAGE);
              }
        }
Пример #55
0
        void RestorePlayerState(bool changeDir)
        {
            switch (NextState)
              {
            case PlayerStates.OnFire:
              SetOnFire();
              break;
            default:
              State = PlayerStates.Standing;
              break;
              }

              if (changeDir)
            Direction *= -1;

              NextState = PlayerStates.Standing;
        }
Пример #56
0
        public void PlayerHugged(object yetiObj)
        {
            Yeti yeti = (Yeti)yetiObj;

              if (State == PlayerStates.Walking
            || State == PlayerStates.Standing
            || State == PlayerStates.Shooting)
              {
            State = PlayerStates.Hugged;
            LastHugged = Game1.CurrentTime;
            Velocity = Vector2.Zero;

            Position = new Vector2(
              yeti.DrawBox.Center.X - yeti.DrawBox.Width / 2,
              yeti.DrawBox.Center.Y - yeti.DrawBox.Height / 2);
              }
        }
Пример #57
0
 void Stop()
 {
     State = PlayerStates.Standing;
       Velocity.X = 0;
 }
Пример #58
0
 public void PlayerHugRelease(object yetiObj)
 {
     if (State == PlayerStates.Hugged)
     State = PlayerStates.Standing;
 }
Пример #59
0
    void switchState(PlayerStates newState)
    {
        switch (playerState)
        {
            case PlayerStates.pregame: preGameExit(); break;
            case PlayerStates.normal: normalExit(); break;
            case PlayerStates.swingingMelee: swingingMeleeExit(); break;
            case PlayerStates.dodging: dodgingExit(); break;
            case PlayerStates.sliding: slidingExit(); break;
            case PlayerStates.dead: deadExit(); break;
        }

        playerState = newState;

        switch (playerState)
        {
            case PlayerStates.pregame: preGameEnter(); break;
            case PlayerStates.normal: normalEnter(); break;
            case PlayerStates.swingingMelee: swingingMeleeEnter(); break;
            case PlayerStates.dodging: dodgingEnter(); break;
            case PlayerStates.sliding: slidingEnter(); break;
            case PlayerStates.dead: deadEnter(); break;
        }
    }
Пример #60
0
 // Use this for initialization
 void Start()
 {
     f_RayLength = 5.0f;
     player = GameObject.FindWithTag("Player").GetComponent<PlayerStates>();
     b_IsOn = false;
 }