Exemplo n.º 1
0
        private void Start()
        {
            CountBreakableBlocks();

            gameStatus     = FindObjectOfType <GameStatus>();
            spriteRenderer = GetComponent <SpriteRenderer>();
            pickupHandler  = GetComponent <PickupHandler>();

            powerupHandler = FindObjectOfType <PowerupHandler>();

            spriteRenderer.sprite = hitSprites[timesHit];
        }
Exemplo n.º 2
0
    override protected void OnTriggerEnter2D(Collider2D collision)
    {
        Ship           shipCollided = collision.GetComponent <Ship>();
        PowerupHandler handler      = shipCollided.GetComponent <PowerupHandler>();


        if (shipCollided != null && handler != null)
        {
            handler.EnhancedShotOn(SHOT_DAMAGE, SHOT_SPEED);
            this.DestroyPowerUp();
        }
    }
Exemplo n.º 3
0
    override protected void OnTriggerEnter2D(Collider2D collision)
    {
        Ship           shipCollided = collision.GetComponent <Ship>();
        PowerupHandler handler      = shipCollided.GetComponentInChildren <PowerupHandler>();


        if (shipCollided != null && handler != null)
        {
            handler.SpeedBoostOn(2f);
            this.DestroyPowerUp();
        }
    }
Exemplo n.º 4
0
    void Awake()
    {
        ourCollider                  = GetComponent <Collider2D>();
        ourCollider.enabled          = false;
        LaunchSoul.SoulToBeLaunched += this.AcceptingCollision;
        LaunchSoul.SoulNotLaunching += this.NotAcceptingCollision;

        shatterParticles = GetComponentInChildren <ParticleSystem>();
        powerupHandler   = GetComponentInParent <PowerupHandler>();

        Switch.SwitchEntered += this.ChangeIconToSwitchVersion;
        Switch.SwitchExited  += this.ChangeIconToOffSwitchVersion;
        ourImage              = GetComponent <Image>();
    }
Exemplo n.º 5
0
        // Start is called before the first frame update
        void Start()
        {
            audioSource = GetComponent <AudioSource>();
            rigidBody2D = GetComponent <Rigidbody2D>();

            powerupHandler = FindObjectOfType <PowerupHandler>();

            gameMode = FindObjectOfType <GameMode>();
            paddle   = gameMode.GetPaddle();

            transform.position = paddle.transform.position + new Vector3(0.0f, 0.5f, 0.0f);

            paddleToBallVector = transform.position - paddle.transform.position;

            launchVelocity = new Vector2(xVelocity, yVelocity);
            launchSpeed    = launchVelocity.magnitude;
            launchVelocity.Normalize();

            if (gameMode.hasStarted)
            {
                rigidBody2D.velocity = launchVelocity * launchSpeed;
            }
        }
Exemplo n.º 6
0
 // Use this for initialization
 void Awake()
 {
     playerMovement = player.GetComponent<PlayerMovement>();
     powerupHandler = player.GetComponent<PowerupHandler>();
 }
Exemplo n.º 7
0
 // Use this for initialization
 void Awake()
 {
     playerMovement = player.GetComponent <PlayerMovement>();
     powerupHandler = player.GetComponent <PowerupHandler>();
 }
Exemplo n.º 8
0
 private void Start()
 {
     powerupHandler = GetComponentInParent <PowerupHandler>();
 }
Exemplo n.º 9
0
 void Start()
 {
     powerupHandler = FindObjectOfType <PowerupHandler>();
 }