Exemple #1
0
        public TileObject(TileObjectManager manager, int tilePosX, int tilePosY)
        {
            this.manager = manager;

            tilePositionX = tilePosX;
            tilePositionY = tilePosY;
        }
Exemple #2
0
        public Powerup(TileObjectManager manager, int tilePosX, int tilePosY, PowerupType pType, Texture2D tex, SoundEffectInstance powerupSound)
            : base(manager, tilePosX, tilePosY)
        {
            this.pType = pType;
            this.powerupTex = tex;
            this.powerupSoundInstance = powerupSound;

            Solid = false;

            //Hook to destroy when burnt
            OnFireSpread += Destroy;
            OnPlayerCollision += PlayerCollect;
        }
Exemple #3
0
        public SoftBlock(TileObjectManager manager, int tilePosX, int tilePosY, Texture2D tex, AnimatedSprite destroyAnimation, int type)
            : base(manager, tilePosX, tilePosY)
        {
            blockTex = tex;
            Solid = true;
            isDead = false;

            //Hook to destroy when burnt
            OnFireSpread += Destroy;

            this.blockType = type;
            sourceRect = new Rectangle(0, type * GlobalGameData.tileSize, GlobalGameData.tileSize, GlobalGameData.tileSize);

            this.destroyAnimation = destroyAnimation;
        }
Exemple #4
0
        public Bomb(TileObjectManager manager, int tilePosX, int tilePosY, Texture2D tex, int power, SoundEffectInstance explodeSound)
            : base(manager, tilePosX, tilePosY)
        {
            bombTex = tex;
            Solid = true;

            this.explodeSoundInstance = explodeSound;

            lifeTimer = new EventTimer(0, 4);

            this.power = power;

            //Hook to explode when life ends
            lifeTimer.OnEnd += Explode;
            OnFireSpread += Explode;
        }
        public Powerup CreatePowerup(TileObjectManager manager, int tilePosX, int tilePosY, PowerupType pType)
        {
            if (!loaded) return null;

            Texture2D pTex;

            switch (pType)
            {
                case PowerupType.BOMB_UP:
                    pTex = powerupTex[0];
                    break;
                case PowerupType.FIRE_UP:
                    pTex = powerupTex[1];
                    break;
                case PowerupType.SPEED_UP:
                    pTex = powerupTex[2];
                    break;
                default:
                    pTex = powerupTex[0];
                    break;
            }

            return new Powerup(manager, tilePosX, tilePosY, pType, pTex, powerupSoundInstance);
        }
Exemple #6
0
 public FireManager(TileObjectManager tileObjectManager)
 {
     this.tileObjectManager = tileObjectManager;
 }
        public SoftBlock CreateSoftBlock(TileObjectManager manager, int tilePosX, int tilePosY, int softblockType)
        {
            if (!loaded) return null;

            return new SoftBlock(manager, tilePosX, tilePosY, blockTex, destroySoftblockAnimation, softblockType);
        }
        public Bomb CreateBomb(TileObjectManager manager, int tilePosX, int tilePosY, int power)
        {
            if (!loaded) return null;

            return new Bomb(manager, tilePosX, tilePosY, bombTex, power, bombExplosionSoundInstance);
        }