Пример #1
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        HamsterController hamster = other.GetComponent <HamsterController>();

        if (hamster != null)
        {
            hamster.ForceBoost(GameControl.BOOST / 20f, GameControl.BOOST);
        }
    }
Пример #2
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        HamsterController hamster = other.GetComponent <HamsterController>();

        if (hamster != null)
        {
            hamster.ForceBoost(GameControl.BOOST, 0);
            transform.position = CollectiblePool.GetNewCollectiblePosition();
        }
    }
    private void OnTriggerEnter2D(Collider2D other)
    {
        HamsterController hamster = other.GetComponent <HamsterController>();

        if (hamster != null)
        {
            hamster.rb2d.velocity = new Vector2(hamster.rb2d.velocity.x, 0f);
            hamster.ForceBoost(GameControl.BOOST, -2 * hamster.rb2d.velocity.y + 2 * GameControl.BOOST);
        }
    }
Пример #4
0
 void firstJump()
 {
     rb2d.constraints = RigidbodyConstraints2D.None;
     instance.ForceBoost(0, (float)((new Random().NextDouble() / 2.0 + 0.5) * GameControl.initialBoost));
 }