Beispiel #1
0
        protected void SetSprite(BulletSpriteIdentifier identifier)
        {
            switch (identifier)
            {
            case BulletSpriteIdentifier.OVAL_SMALL:
            case BulletSpriteIdentifier.OVAL_LARGE:
                _spriteRotation = SpriteRotation.ROTATE;
                break;

            case BulletSpriteIdentifier.STAR_SMALL:
            case BulletSpriteIdentifier.STAR_LARGE:
                _spriteRotation = SpriteRotation.SPIN;
                break;

            default:
                _spriteRotation = SpriteRotation.NONE;
                break;
            }
            if (identifier == BulletSpriteIdentifier.NONE)
            {
                _spriteRenderer.sprite = null;
                return;
            }
            _spriteRenderer.sprite = _spriteDictionary[identifier];
        }
 public BulletDataContainer(int delay, float?speed, float acceleration, float maxSpeed, float?angle, float rotation, BulletSpriteIdentifier sprite)
 {
     Delay        = delay;
     Speed        = speed;
     Acceleration = acceleration;
     MaxSpeed     = maxSpeed;
     Angle        = angle;
     Rotation     = rotation;
     BulletSprite = sprite;
 }
Beispiel #3
0
        protected void SetHitBox(BulletSpriteIdentifier identifier)
        {
            switch (identifier)
            {
            case BulletSpriteIdentifier.ROUND_SMALL:
                _hitBox.Set(8, 8);
                break;

            case BulletSpriteIdentifier.ROUND_MEDIUM:
                _hitBox.Set(18, 18);
                break;

            case BulletSpriteIdentifier.ROUND_LARGE:
                _hitBox.Set(26, 26);
                break;

            case BulletSpriteIdentifier.OVAL_SMALL:
                _hitBox.Set(22, 12);
                break;

            case BulletSpriteIdentifier.OVAL_LARGE:
                _hitBox.Set(33, 17);
                break;

            case BulletSpriteIdentifier.STAR_SMALL:
                _hitBox.Set(11, 11);
                break;

            case BulletSpriteIdentifier.STAR_LARGE:
                _hitBox.Set(19, 19);
                break;

            default:
                _hitBox = Vector2.zero;
                break;
            }
        }
Beispiel #4
0
 protected void SetBulletData(int delay, float?speed, float acceleration, float maxSpeed, float?angle, float rotation, BulletSpriteIdentifier sprite)
 {
     if (_gameManager.GetBullet() != null)
     {
         _gameManager.GetBullet().AddData(new BulletDataContainer(delay, speed, acceleration, maxSpeed, angle, rotation, sprite));
     }
 }