Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        airMovementComponent = GetComponentInChildren <AirMovement>();
        staminaBar           = GetComponentInChildren <StaminaBar>();

        Input.multiTouchEnabled = false;
        rigidBody = GetComponent <Rigidbody2D>();

        maxRotationDownRight = 360f - maxRotationUp;
        maxRotationUpLeft    = 360f - maxRotationUp;
        maxRotationDownLeft  = maxRotationUp;

        startArrowXScale = slingArrowObject.localScale.x;
        emptyPrefab      = new GameObject();

        minMaskScale          = slingMaskObject.localScale.x;
        scaleXTotalDifference = maxMaskScale - minMaskScale;

        currentMaxMagnitude        = maxMagnitudeOfSlingVector;
        currentMaxTime             = maxTimeAtMaxSlingMagnitude;
        currentMaxTimeTemp         = currentMaxTime;
        currentMaxMaskScale        = maxMaskScale;
        currentMaxPowerupMaskScale = maxPowerUpMaskScale;

        differenceTotalForce = maxForceToApply - minForceToApply;

        minPowerupMaskScale = powerupMaskObject.localScale.x;
    }
        public void TestAirMovement()
        {
            var movement = new AirMovement();
            var monster  = new Monster {
                MonsterIndex = 1, Position = 1
            };

            movement.Move(monster);

            Assert.True(monster.Position == 3 && monster.MonsterIndex == 1);
        }
    // Use this for initialization
    void Start()
    {
        boost           = new Boost(currentMovementConfig);
        jump            = new Jump(currentMovementConfig);
        uprightMovement = new UprightMovement(currentMovementConfig);
        airMovement     = new AirMovement(currentMovementConfig);

        raycaster = GetComponent <RaycastController>();
        rb        = GetComponent <Rigidbody>();

        input = FindObjectOfType <InputController>();
    }
    // Use this for initialization
    protected override void Start()
    {
        base.Start();
        keeper           = GetComponent <PathKeeper>();
        target           = GameObject.Find("Player");
        targetDamageable = target.GetComponent <IDamageable>();
        targetKeeper     = target.GetComponent <PathKeeper>();
        rb       = GetComponent <Rigidbody>();
        movement = GetComponent <AirMovement>();

        anim = GetComponentInChildren <Animator>();
    }
Beispiel #5
0
 protected virtual void Awake()
 {
     if (f_needsGroundMovement)
     {
         f_groundMovement = new GroundMovementRaycast(this, f_height, HalfWidth, this is Player);
         f_movement       = f_groundMovement;
     }
     else
     {
         f_airMovement = new AirMovement(this);
         f_movement    = f_airMovement;
     }
 }
    // Start is called before the first frame update
    private void Start()
    {
        _control = new PlayerController(this, GetComponent <PlayerView>());

        _groundMovementStrategy = new GroundMovement(transform, onXMovement, DownwardsCollisionCheck);
        _airMovementStrategy    = new AirMovement(transform, DownwardsCollisionCheck);

        SetNewStrategies(_groundKeys, _groundMovementStrategy);

        //_ui = GetComponent<UpdateUI>();
        _miniUI = GetComponent <UpdateMiniUI>();

        ChangeSkin(0);
        _miniUI.UpdateSkillText(_mySkins.IndexOf(_currentSkin), SkillsAndValues[_currentSkin]());

        //_ui.UpdateHPText(stats.hp);
        //_ui.UpdateLivesText(stats.lives);
        _miniUI.UpdateHPText(stats.hp);
        _miniUI.UpdateLivesText(stats.lives);

        stats.CurrentSceneIndex = SceneManager.GetActiveScene().buildIndex;
    }
 public Dragon()
 {
     movement   = new AirMovement();
     attackType = new FlameAttack();
     level      = new LevelOne();
 }
 public Dragon(ILevel level)
 {
     movement   = new AirMovement();
     attackType = new FlameAttack();
     this.level = level;
 }