예제 #1
0
        public PowerUpGUIItem(Vector2 spritePosition, PowerUpType type) : base(spritePosition, "speedUp")
        {
            Type    = type;
            Enabled = false;
            sprite.SetMultiplyTint(colorDisabled);

            switch (type)
            {
            //mettere costanti nelle classi
            case PowerUpType.SpeedUp:
                texture = GfxManager.GetSpritesheet("speedUp").Item1;
                break;

            case PowerUpType.SpeedDown:
                texture = GfxManager.GetSpritesheet("speedDown").Item1;
                break;

            case PowerUpType.BombUp:
                texture = GfxManager.GetSpritesheet("bombUp").Item1;
                break;

            case PowerUpType.BombDown:
                texture = GfxManager.GetSpritesheet("bombDown").Item1;
                break;

            case PowerUpType.Invincibility:
                texture = GfxManager.GetSpritesheet("invincibility").Item1;
                break;

            case PowerUpType.ExtraLife:
                texture = GfxManager.GetSpritesheet("extraLife").Item1;
                break;
            }
        }
예제 #2
0
 public BombPowerUp(Vector2 spritePosition, BombType bombType) : base(spritePosition, "bombUp")
 {
     if (bombType == BombType.Up)
     {
         Type = PowerUpType.BombUp;
         timeToDeactivePowerUp = 16f;
     }
     else
     {
         texture = GfxManager.GetSpritesheet("bombDown").Item1;
         Type    = PowerUpType.BombDown;
         timeToDeactivePowerUp = 8f;
         clipOnPicked          = AudioManager.GetAudioClip("powerUp2");
     }
 }
예제 #3
0
파일: Circle.cs 프로젝트: ngaeta/Bomberman
        public Circle(Vector2 offset, RigidBody owner, float ray)
        {
            relativePosition = offset;
            RigidBody        = owner;
            Ray = ray;

            if (Debug)
            {
                IsActive       = true;
                circleCollider = new Sprite(ray * 2, ray * 2);
                texture        = GfxManager.GetSpritesheet("circle").Item1;
                Layer          = DrawManager.Layer.Foreground;
                DrawManager.AddItem(this);
                UpdateManager.AddItem(this);
            }
        }
예제 #4
0
 public SpeedPowerUp(Vector2 spritePosition, SpeedType speedType) : base(spritePosition, "speedUp")
 {
     if (speedType == SpeedType.UP)
     {
         speedIncrement        = 2f;
         Type                  = PowerUpType.SpeedUp;
         timeToDeactivePowerUp = 15f;
     }
     else
     {
         Type                  = PowerUpType.SpeedDown;
         speedIncrement        = -2f;
         texture               = GfxManager.GetSpritesheet("speedDown").Item1;
         timeToDeactivePowerUp = 10f;
         clipOnPicked          = AudioManager.GetAudioClip("powerUp2");
     }
 }
예제 #5
0
파일: Rect.cs 프로젝트: ngaeta/Bomberman
        public Rect(Vector2 offset, RigidBody owner, float width, float height)
        {
            relativePosition = offset;
            RigidBody        = owner;
            HalfWidth        = width / 2;
            HalfHeight       = height / 2;

            if (Debug)
            {
                IsActive     = true;
                rectCollider = new Sprite(width, height);
                texture      = GfxManager.GetSpritesheet("rectangle").Item1;
                Layer        = DrawManager.Layer.Foreground;
                DrawManager.AddItem(this);
                UpdateManager.AddItem(this);
            }
        }
예제 #6
0
        public GameObject(
            Vector2 spritePosition, string spriteSheetName,
            DrawManager.Layer drawLayer = DrawManager.Layer.Playground)
        {
            Tuple <Texture, List <Animation> > ss = GfxManager.GetSpritesheet(spriteSheetName);

            texture         = ss.Item1;
            animations      = ss.Item2;
            Animation       = animations[0];
            sprite          = new Sprite(Game.PixelsToUnit(Animation.FrameWidth), Game.PixelsToUnit(Animation.FrameHeight));
            sprite.position = spritePosition;
            sprite.pivot    = new Vector2(Width / 2, Height / 2);
            layer           = drawLayer;
            IsActive        = true;

            UpdateManager.AddItem(this);
            DrawManager.AddItem(this);
        }