Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        maxHP   = 5;
        grimHP  = maxHP;
        maxKeys = 4;
        player  = GetComponent <PlatformerController>();
        physics = GetComponent <PlatformerPhysics> ();

        maskDifference = PlayerPrefs.GetFloat("soulCount");
        goodDash       = PlayerPrefs.GetInt("goodDash");
        evilDash       = PlayerPrefs.GetInt("evilDash");
        evilAttack     = PlayerPrefs.GetInt("evilAttack");
        goodAttack     = PlayerPrefs.GetInt("goodAttack");
        //healthScale = healthBar.transform.localScale;
        //healthBar = GameObject.Find("HealthBar").GetComponent<SpriteRenderer>();
        if (evilDash == 1)
        {
            physics.hasEvilDash = true;
        }
        else if (goodDash == 1)
        {
            physics.hasGoodDash = true;
        }

        if (evilAttack == 1)
        {
            physics.hasEvilAttack = true;
        }
        else if (goodAttack == 1)
        {
            physics.hasGoodAttack = true;
        }
    }
Ejemplo n.º 2
0
 void Start()
 {
     sprite     = GetComponent <SpriteRenderer>();
     phys       = GetComponent <Rigidbody2D>();
     controller = GetComponent <PlatformerController>();
     direction  = transform.lossyScale.x;
 }
Ejemplo n.º 3
0
 void Start()
 {
     startPos     = transform.position;
     manager      = GameObject.FindObjectOfType <Manager>();
     player       = GameObject.FindObjectOfType <PlatformerController>();
     controlTimer = controlDelay;
 }
Ejemplo n.º 4
0
    void Awake()
    {
        mPlayer = GetComponent <Player>();
        mPlayer.spawnCallback    += OnPlayerSpawn;
        mPlayer.setStateCallback += OnPlayerSetState;
        mPlayer.setBlinkCallback += OnPlayerBlink;

        mBody = GetComponentInChildren <PlatformerController>();

        mBody.player     = 0;
        mBody.moveInputX = InputAction.MoveX;
        mBody.moveInputY = InputAction.MoveY;
        mBody.jumpInput  = InputAction.Jump;

        mBody.jumpCallback          += OnBodyJump;
        mBody.collisionStayCallback += OnBodyCollisionStay;
        mBody.triggerEnterCallback  += OnBodyTriggerEnter;

        mBodySpriteCtrl = mBody.GetComponent <PlatformerSpriteController>();
        mBodySpriteCtrl.flipCallback            += OnFlipCallback;
        mBodySpriteCtrl.anim.AnimationCompleted += OnBodySpriteAnimFinish;

        mBombCtrl = bomb.GetComponent <BombController>();
        mBombCtrl.deathCallback += OnBombDeathCallback;

        mTargetGO = GameObject.FindGameObjectWithTag("Goal");
    }
Ejemplo n.º 5
0
 // Start is called before the first frame update
 void Start()
 {
     anim         = GetComponent <Animator>();
     PlayerScript = GetComponent <PlatformerController>();
     rb2d         = GetComponent <Rigidbody2D>();
     FallingTimer = 0.1f;
 }
Ejemplo n.º 6
0
    void Awake()
    {
        _instance = this;
        rigid     = this.GetComponent <Rigidbody2D>();
        if (rigid == null)
        {
            rigid                         = this.gameObject.AddComponent <Rigidbody2D>();
            rigid.constraints             = RigidbodyConstraints2D.FreezeRotation;
            rigid.sharedMaterial          = new PhysicsMaterial2D();
            rigid.sharedMaterial.friction = 0;
            rigid.collisionDetectionMode  = CollisionDetectionMode2D.Continuous;
            rigid.interpolation           = RigidbodyInterpolation2D.Extrapolate;
            rigid.freezeRotation          = true;
        }

        PhysicsMaterial2D material = new PhysicsMaterial2D();

        material.friction = 0;
        this.GetComponent <Collider2D>().sharedMaterial = material;

        anim = this.GetComponent <Animator>();
        if (anim == null)
        {
            anim = this.gameObject.AddComponent <Animator>();
        }

        render = this.GetComponent <SpriteRenderer>();
        if (render == null)
        {
            render = this.gameObject.AddComponent <SpriteRenderer>();
        }
    }
Ejemplo n.º 7
0
 void OnLanded(PlatformerController ctrl)
 {
     bodyCtrl.moveSide = 0.0f;
     mJump             = false;
     mLastJumpTime     = Time.fixedTime;
     mProjIsShot       = false;
 }
Ejemplo n.º 8
0
 private void Initialize()
 {
     if (!character)
     {
         character = GameObject.Find("Character");
     }
     if (!boxCollider)
     {
         boxCollider = GetComponent <BoxCollider2D>();
     }
     if (SettingsIsNull)
     {
         settings = CreateInstance <RaycastSettings>();
     }
     if (InitializePlatformerController)
     {
         platformerController = GetComponent <PlatformerController>();
     }
     if (InitializeLayerMaskController)
     {
         layerMaskController = GetComponent <LayerMaskController>();
     }
     if (InitializePhysicsController)
     {
         physicsController = GetComponent <PhysicsController>();
     }
     if (DataIsNull)
     {
         Data = CreateInstance <RaycastData>();
     }
     Data.OnInitialize(ref boxCollider, ref character, settings);
 }
Ejemplo n.º 9
0
 private void Awake()
 {
     _sprite     = GetComponent <SpriteRenderer>();
     _animator   = GetComponent <Animator>();
     _rigidbody  = GetComponent <Rigidbody2D>();
     _controller = GetComponent <PlatformerController>();
 }
Ejemplo n.º 10
0
 // Use this for initialization
 void Start()
 {
     spriteRenderer       = GetComponent <SpriteRenderer>();
     audioSource          = GetComponent <AudioSource>();
     platformerController = GetComponent <PlatformerController>();
     bounds = GetComponent <Collider2D>().bounds;
 }
Ejemplo n.º 11
0
    // Use this for initialization
    void Start()
    {
        //Get the speed of light from the platformer controler
        //as well as Jenny's speed.
        player = GameObject.Find("Jenny");
        platformerController = player.GetComponent("PlatformerController") as PlatformerController;
        //The script needs to access PickingUpObjects script on Jenny
        //pickingUpObjects = player.GetComponent("PickingUpObjects") as PickingUpObjects;

        timer = transform.parent.FindChild("Timer") as Transform;


        //physConst = GameObject.Find ("PhysicalConstants");
        //physicsConstants = physConst.GetComponent("PhysicsConstants") as PhysicsConstants;
        //SpeedOfLight=physicsConstants.SpeedOfLight;

        lorentzContraction = transform.GetComponent("LorentzContraction")
                             as LorentzContraction;

        //	explosionInitiated = false;



        bombExplosionSpawner = transform.parent.GetComponent("BombExplosionSpawner") as BombExplosionSpawner;
    }
Ejemplo n.º 12
0
 // Start is called before the first frame update
 void Start()
 {
     anim       = GetComponent <Animator>();
     controller = GetComponent <PlatformerController>();
     coll       = GetComponent <Collision>();
     sr         = GetComponent <SpriteRenderer>();
 }
 // Use this for initialization
 void Start()
 {
     levelCamera          = CameraTracking.cameraTracking.gameObject;
     platformerController = PlatformerController.platformerController;
     //The scene fader is needed to call the end scene function;
     sceneFadeInOut = SceneFadeInOut.sceneFadeInOut;
 }
Ejemplo n.º 14
0
    void Update()
    {
        PlatformerController controller = GetComponent("PlatformerController") as PlatformerController;

        // We are not falling off the edge right now
        if (controller.GetHangTime() < hangTimeUntilFallingAnimation)
        {
            // Are we moving the character?
            if (controller.IsMoving())
            {
                if (Input.GetButton("Fire2"))
                {
                    GetComponent <Animation>().CrossFade("run");
                }
                else
                {
                    GetComponent <Animation>().CrossFade("walk");
                }
            }
            // Go back to idle when not moving
            else
            {
                GetComponent <Animation>().CrossFade("idle", 0.5f);
            }
        }
        // When falling off an edge, after hangTimeUntilFallingAnimation we will fade towards the ledgeFall animation
        else
        {
            GetComponent <Animation>().CrossFade("ledgeFall");
        }
    }
Ejemplo n.º 15
0
    void Start()
    {
        source         = GetComponent <AudioSource> ();
        controller     = GetComponent <PlatformerController>();
        groundCollider = controller.groundCollider;
        for (int i = 1; i < blocksArray.Length; i++)
        {
            blocksArray [i] = GameObject.FindGameObjectWithTag("Block" + i);
            blocksArray [i].gameObject.SetActive(false);
        }

        // Play start of level sound
        source.clip   = startLevelSound;
        source.volume = 1f;
        source.pitch  = 1f;
        source.PlayOneShot(startLevelSound);

        // Set position of lowest object for reference of dying
        GameObject[] platforms = GameObject.FindGameObjectsWithTag("Platform");
        lowestPlatformPos = float.PositiveInfinity;
        foreach (GameObject platform in platforms)
        {
            if (platform.transform.position.y < lowestPlatformPos)
            {
                lowestPlatformPos = platform.transform.position.y;
            }
        }
    }
Ejemplo n.º 16
0
 void OnLand(PlatformerController ctrl)
 {
     if (state != (int)EntityState.Invalid)
     {
         Vector2 p = transform.position;
         PoolController.Spawn("fxp", "landdust", "landdust", null, p);
     }
 }
Ejemplo n.º 17
0
    protected override void Awake() {
        base.Awake();

        mCtrl = GetComponent<PlatformerController>();
        mCtrl.gravityController.enabled = false;

        mBlinker = GetComponent<EntityDamageBlinkerSprite>();
    }
 // Start is called before the first frame update
 void Start()
 {
     player = PlatformerController.instance;
     rb     = GetComponent <Rigidbody2D>();
     rb.AddForce((player.transform.position - transform.position).normalized * speed);
     //destroy itself after 5 seconds
     StartCoroutine(DestroyProjectile());
 }
Ejemplo n.º 19
0
 // Use this for initialization
 void Start()
 {
     spriteRenderer       = GetComponent <SpriteRenderer>();
     audioSource          = GetComponent <AudioSource>();
     platformerController = GetComponent <PlatformerController>();
     bounds = GetComponent <Collider2D>().bounds;
     player = GameObject.FindGameObjectWithTag("Player").transform;
 }
Ejemplo n.º 20
0
 // Use this for initialization
 void Start()
 {
     explodeOnCooldown = false;
     //initialize the player
     player = gameObject.GetComponentInParent <PlatformerController> ();
     //initialize the blast list
     colliderList = new List <Collider2D> ();
 }
Ejemplo n.º 21
0
 // Start is called before the first frame update
 void Start()
 {
     line = this.transform;
     //line.useWorldSpace = false;
     playerScript = GameObject.FindGameObjectWithTag("Player").GetComponent<PlatformerController>();
     length = 0;
     line.localScale = new Vector3( width, line.localScale.y, line.localScale.z);
 }
Ejemplo n.º 22
0
 void OnTriggerEnter(Collider col)
 {
     if (MatchTag(col.gameObject))
     {
         mController          = col.GetComponent <PlatformerController>();
         mController.lockDrag = true;
         col.rigidbody.drag   = drag;
     }
 }
Ejemplo n.º 23
0
    protected override void Awake()
    {
        base.Awake();

        mCtrl = GetComponent <PlatformerController>();
        mCtrl.gravityController.enabled = false;

        mBlinker = GetComponent <EntityDamageBlinkerSprite>();
    }
Ejemplo n.º 24
0
 private void Awake()
 {
     sunExploded       = false;
     blackHoleIsActive = false;
     blackHole.SetActive(blackHoleIsActive);
     sun                 = GameObject.FindGameObjectWithTag(Constants.SUN);
     planets             = new List <GameObject>(GameObject.FindGameObjectsWithTag(Constants.CELESTIAL_BODY));
     characterController = FindObjectOfType <PlatformerController>();
 }
Ejemplo n.º 25
0
    void OnLanded(PlatformerController ctrl)
    {
        mJump         = false;
        mLastJumpTime = Time.fixedTime;

        Vector2 p = transform.position;

        PoolController.Spawn("fxp", "landdust", "landdust", null, p);
    }
Ejemplo n.º 26
0
 // Use this for initialization
 void Start()
 {
     spriteRenderer = GetComponent <SpriteRenderer>();
     if (gameObject.GetComponent <Collider2D>() != null)
     {
         m_Collider = GetComponent <Collider2D>();
     }
     Player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlatformerController>();
     //GetComponent<Rigidbody2D>().bodyType = RigidbodyType2D.Static;
 }
Ejemplo n.º 27
0
    void OnTriggerEnter(Collider other)
    {
        PlatformerController controller = other.gameObject.GetComponent <PlatformerController>();

        if (controller && controller.HasControl())
        {
            //let player die
            StartCoroutine(PlayerDeath(other.gameObject));
        }
    }
Ejemplo n.º 28
0
 void OnLanded(PlatformerController ctrl) {
     switch(mCurPhase) {
         case Phase.Jump:
         case Phase.AirStrike:
         case Phase.ThrowGrenades:
             Jump(0);
             ToPhase(Phase.Move);
             break;
     }
 }
Ejemplo n.º 29
0
    protected override void Awake()
    {
        mInstance = this;

        base.Awake();

        mTimeTrial = LevelController.isTimeTrial;

        //CameraController camCtrl = CameraController.instance;
        //camCtrl.transform.position = collider.bounds.center;

        //initialize variables
        Main.instance.input.AddButtonCall(0, InputAction.MenuEscape, OnInputPause);

        mCtrl = GetComponent <PlatformerController>();
        mCtrl.collisionEnterCallback += OnRigidbodyCollisionEnter;
        mCtrl.landCallback           += OnLand;

        mDefaultCtrlMoveMaxSpeed = mCtrl.moveMaxSpeed;
        mDefaultCtrlMoveForce    = mCtrl.moveForce;

        mCtrlSpr = GetComponent <PlatformerSpriteController>();

        mCtrlSpr.clipFinishCallback += OnSpriteCtrlOneTimeClipEnd;

        mCapsuleColl           = collider as CapsuleCollider;
        mDefaultColliderCenter = mCapsuleColl.center;
        mDefaultColliderHeight = mCapsuleColl.height;

        mStats = GetComponent <PlayerStats>();

        mBlinks = GetComponentsInChildren <SpriteColorBlink>(true);
        foreach (SpriteColorBlink blinker in mBlinks)
        {
            blinker.enabled = false;
        }

        if (deathGOActivate)
        {
            deathGOActivate.SetActive(false);
        }

        //disable autosave if hardcore
        if (SlotInfo.gameMode == SlotInfo.GameMode.Hardcore)
        {
            //preserveEnergySpent = true;
            mStats.hpPersist           = true;
            PlayerStats.savePersist    = true;
            UserData.instance.autoSave = LevelController.isLevelLoadedComplete;
        }
        else
        {
            PlayerStats.savePersist = false;
        }
    }
Ejemplo n.º 30
0
 void OnTriggerEnter(Collider col)
 {
     if (col.gameObject.CompareTag(checkTag))
     {
         PlatformerController ctrl = col.GetComponent <PlatformerController>();
         if (!ctrl.isGrounded)
         {
             ctrl.jumpCounterCurrent = counter;
         }
     }
 }
Ejemplo n.º 31
0
    // Use this for initialization
    void Start()
    {
        controller = gameObject.GetComponent <PlatformerController>();
        sr         = gameObject.GetComponent <SpriteRenderer>();
        rb2d       = gameObject.GetComponent <Rigidbody2D>();

        // Start white, without having any powers unlocked
        currentMode    = Mode.White;
        redUnlocked    = false;
        yellowUnlocked = false;
        blueUnlocked   = false;
    }
Ejemplo n.º 32
0
    protected override void Awake() {
        mInstance = this;

        base.Awake();

        //CameraController camCtrl = CameraController.instance;
        //camCtrl.transform.position = collider.bounds.center;

        //initialize variables
        Main.instance.input.AddButtonCall(0, InputAction.MenuEscape, OnInputPause);

        mCtrl = GetComponent<PlatformerController>();
        mCtrl.moveInputX = InputAction.MoveX;
        mCtrl.moveInputY = InputAction.MoveY;
        mCtrl.collisionEnterCallback += OnRigidbodyCollisionEnter;

        mDefaultCtrlMoveMaxSpeed = mCtrl.moveMaxSpeed;
        mDefaultCtrlMoveForce = mCtrl.moveForce;

        mCtrlSpr = GetComponent<PlatformerSpriteController>();

        mCtrlSpr.clipFinishCallback += OnSpriteCtrlOneTimeClipEnd;

        mCapsuleColl = collider as CapsuleCollider;
        mDefaultColliderCenter = mCapsuleColl.center;
        mDefaultColliderHeight = mCapsuleColl.height;

        mStats = GetComponent<PlayerStats>();

        mBlinks = GetComponentsInChildren<SpriteColorBlink>(true);
        foreach(SpriteColorBlink blinker in mBlinks) {
            blinker.enabled = false;
        }

        if(deathGOActivate)
            deathGOActivate.SetActive(false);
    }
    void Awake() {
        if(anim == null)
            anim = GetComponent<tk2dSpriteAnimator>();

        mIsLeft = defaultLeft;

        if(anim) {
            anim.AnimationCompleted += OnAnimationComplete;
            anim.AnimationEventTriggered += OnAnimationFrameEvent;


            anim.Sprite.FlipX = mIsLeft ? leftFlip : !leftFlip;

            mDefaultAnimLib = anim.Library;
            mDefaultClipDat = new ClipData(this, mDefaultAnimLib);
                    
            mLibClips = new ClipData[animLibs.Length];
            for(int i = 0, max = animLibs.Length; i < max; i++) {
                mLibClips[i] = new ClipData(this, animLibs[i]);
            }
        }

        if(multiSprites) {
            mMultiSprites = GetComponentsInChildren<tk2dBaseSprite>(true);
            for(int i = 0; i < mMultiSprites.Length; i++)
                mMultiSprites[i].FlipX = mIsLeft ? leftFlip : !leftFlip;
        }

        if(controller == null)
            controller = GetComponent<PlatformerController>();
    }
Ejemplo n.º 34
0
 void OnTankLanded(PlatformerController ctrl) {
     switch(mCurPhase) {
         case Phase.Move:
             if(!IsInvoking(moveToPlayerFunc))
                 InvokeRepeating(moveToPlayerFunc, 0.0f, moveFacePlayerDelay);
             break;
     }
 }
 void Start()
 {
     controller = (PlatformerController)GetComponent ("PlatformerController");
 }
Ejemplo n.º 36
0
 public virtual bool WindTunnelCollisionResolution(PlatformerController pc)
 {
     // NO EFFECT
     pc.externalAcc = Vector3.zero;
     return false;
 }
Ejemplo n.º 37
0
    protected override void Awake() {
        base.Awake();

        mStats = GetComponent<Stats>();
        mStats.changeHPCallback += OnStatsHPChange;
        mStats.isInvul = true;

        mBodyCtrl = GetComponent<PlatformerController>();
        if(mBodyCtrl)
            mBodyCtrl.moveSideLock = true;

        mGravCtrl = GetComponent<GravityController>();

        mBodySpriteCtrl = GetComponent<PlatformerSpriteController>();

        mDamageTriggers = GetComponentsInChildren<Damage>(true);

        if(!FSM)
            autoSpawnFinish = true;

        if(stunGO)
            stunGO.SetActive(false);

        if(activator)
            mDefaultDeactiveDelay = activator.deactivateDelay;

        if(deathActivateGO)
            deathActivateGO.SetActive(false);

        //initialize variables
    }
Ejemplo n.º 38
0
    protected override void StateChanged() {
        switch((EntityState)prevState) {
            case EntityState.Normal:
                CancelInvoke(activeFunc);
                //CancelInvoke(fireStartFunc);
                mFiring = false;

                Blink(0);
                if(projInactiveInvul) stats.isInvul = false;
                bodySpriteCtrl.StopOverrideClip();
                break;
        }

        base.StateChanged();

        switch((EntityState)state) {
            case EntityState.Normal:
                CancelInvoke(activeFunc);
                //CancelInvoke(fireStartFunc);
                mFiring = false;

                if(!mRock) {
                    Vector3 rockPos = transform.position;
                    rockPos.y += rockYOfs;
                    mRock = Projectile.Create(projGroup, rockProjType, rockPos, Vector3.zero, null);

                    mRockCtrl = mRock.GetComponent<PlatformerController>();
                    mRockBlinkDelay = mRock.GetComponent<EntityBlinkDelay>();

                    bodySpriteCtrl.controller = mRockCtrl;

                    if(rollerDieDelayOverride) {
                        mRock.dieBlink = false;
                        mRock.dieDelay = 0.0f;
                    }
                }

                mRockCtrl.dirHolder = transform;
                mRockCtrl.moveSideLock = true;
                mRockCtrl.moveSide = defaultMoveSide;

                if(mRockBlinkDelay)
                    mRockBlinkDelay.enabled = false;

                if(mSensor) {
                    mSensor.Activate(true);
                }

                if(!string.IsNullOrEmpty(projType)) {
                    if(mPlayers == null)
                        mPlayers = GameObject.FindGameObjectsWithTag("Player");

                    InvokeRepeating(activeFunc, 0, projActiveCheckDelay);

                    if(projInactiveInvul) stats.isInvul = true;
                    if(!string.IsNullOrEmpty(projInactiveClip))
                        bodySpriteCtrl.PlayOverrideClip(projInactiveClip);
                }
                    //Invoke(fireStartFunc, projStartDelay);
                break;

            case EntityState.Stun:
                mRockCtrl.moveSide = 0.0f;
                break;

            case EntityState.Dead:
                if(mRock && mRock.isAlive) {
                    if(rollerDieDelayOverride) {
                        if(mRockBlinkDelay) {
                            mRockBlinkDelay.delay = rollerDieDelay - rollerDieBlinkDelay;
                            mRockBlinkDelay.enabled = true;
                        }
                        else {
                            mRock.dieBlink = true;
                        }

                        mRock.dieDelay = rollerDieDelay;
                    }

                    if(mRock.stats)
                        mRock.stats.curHP = 0;
                    else
                        mRock.state = (int)Projectile.State.Dying;

                    mRock = null;
                }

                if(mSensor) {
                    mSensor.Activate(false);
                }

                bodySpriteCtrl.controller = null;
                break;

            case EntityState.RespawnWait:
                if(mRock && !mRock.isReleased) {
                    mRock.Release();
                    mRock = null;
                    mRockCtrl = null;
                    mRockBlinkDelay = null;
                }

                if(mSensor) {
                    mSensor.Activate(false);
                }

                bodySpriteCtrl.controller = null;

                RevertTransform();
                break;
        }
    }
Ejemplo n.º 39
0
    // Use this for initialization
    void Start()
    {
        m_currentState = (int)State.Default;

        // instantiate each state of matter
        m_defaultMatty = Instantiate (defaultMatty, gameObject.transform.position, Quaternion.identity) as GameObject;
        m_solidMatty = Instantiate (solidMatty, gameObject.transform.position, Quaternion.identity) as GameObject;
        m_liquidMatty = Instantiate (liquidMatty, gameObject.transform.position, Quaternion.identity) as GameObject;
        m_gasMatty = Instantiate (gasMatty, gameObject.transform.position, Quaternion.identity) as GameObject;
        m_plasmaMatty = Instantiate (plasmaMatty, gameObject.transform.position, Quaternion.identity) as GameObject;

        // find the class associated with each state of matter
        m_defaultMattyScript = m_defaultMatty.GetComponent<MattyScript>();
        m_solidMattyScript = m_solidMatty.GetComponent<MattySolidScript>();
        m_liquidMattyScript = m_liquidMatty.GetComponent<MattyLiquidScript>();
        m_gasMattyScript = m_gasMatty.GetComponent<MattyGasScript>();
        m_plasmaMattyScript = m_plasmaMatty.GetComponent<MattyPlasmaScript>();
        m_platCtrlScript = gameObject.GetComponent<PlatformerController>();

        // Temp: Make sure this collider does not collide with each state of matter's colliders
        Physics.IgnoreCollision(collider, m_defaultMatty.collider);
        Physics.IgnoreCollision(collider, m_solidMatty.collider);
        Physics.IgnoreCollision(collider, m_plasmaMatty.collider);

        playerDead = false;
        m_camera = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<CameraFollow>();
        dir = GameObject.FindGameObjectWithTag ("Director").GetComponent<Director>();

        collidedWithGrates = false;

        origWalkSpeed = m_platCtrlScript.movement.walkSpeed;
        origExtraHeight = m_platCtrlScript.jump.extraHeight;
        spawnPoint = new Vector3 ();
        spawnPoint = dir.GetSpawnPoint ();
        m_platCtrlScript.SetSpawnPoint (spawnPoint, true);

        m_platCtrlScript.movement.maxSpeedUp = dir.GetMaxSpeedUp ();

        enableState ((int)State.Default);
    }
Ejemplo n.º 40
0
    void OnLanded(PlatformerController ctrl) {
        if(mJumping) {
            Vector3 pos = collider.bounds.center; pos.z = 0;
            Vector3 targetPos = mTarget.collider.bounds.center;
            Projectile.Create(projGroup, projType, pos, new Vector3(Mathf.Sign(targetPos.x - pos.x), 0, 0), null);


            mJumping = false;
            bodyCtrl.rigidbody.velocity = Vector3.zero;
            bodyCtrl.moveSide = 0.0f;
            Jump(0);
            anim.Play(landClip);
        }
    }
Ejemplo n.º 41
0
 public void WindTunnelExit(PlatformerController pc)
 {
     pc.externalAcc = Vector3.zero;
 }
Ejemplo n.º 42
0
 public override bool WindTunnelCollisionResolution(PlatformerController pc)
 {
     // NO EFFECT
     pc.externalAcc = windTunnelAccel;
     return false;
 }