예제 #1
0
파일: Gem.cs 프로젝트: BitSits/Gombli
        /// <summary>
        /// Constructs a new gem.
        /// </summary>
        public Gem(Level level, Vector2 position)
        {
            this.level = level;
            this.basePosition = position;

            LoadContent();
        }
예제 #2
0
        public MovingTile(Level level, int index, Vector2 basePosition, Orientation type)
        {
            this.level = level;
            this.position = basePosition;
            this.dirType = type;

            LoadContent(index);
        }
예제 #3
0
파일: Bubble.cs 프로젝트: BitSits/Gombli
        private bool onTop; // 0 - Down and Back 1 - Top and Front

        #endregion Fields

        #region Constructors

        public Bubble(Level level, Vector2 position, bool onTop, bool playPick)
            : base(level, position)
        {
            PowerIndex = 2; this.onTop = onTop;
            velocity = Vector2.Zero;

            this.playPick = playPick;
            LoadContent();
        }
예제 #4
0
파일: OzoneTile.cs 프로젝트: BitSits/Gombli
        public OzoneTile(Level level, Vector2 position, char type)
        {
            this.position = position;
            this.OriginalGlow = this.IsGlowing = type == '0' ? false : true;

            this.isStatic = type == '2' ? true : false;

            blockOFF = level.Content.Load<Texture2D>("Tiles/Ozone0");
            blockON = level.Content.Load<Texture2D>("Tiles/Ozone1");
            blockSTATIC = level.Content.Load<Texture2D>("Tiles/Ozone2");
        }
예제 #5
0
        public BreakableTile(Level level, Point basePosition)
        {
            this.position = basePosition;
            State = PowerState.Ground;

            this.block0 = level.Content.Load<Texture2D>("Tiles/" + level.LevelIndex.ToString() + "_BlockA0");
            this.block1 = level.Content.Load<Texture2D>("Tiles/" + level.LevelIndex.ToString() + "_BlockA1");

            this.overlay0 = level.Content.Load<Texture2D>("Tiles/BreakOverlay0");
            this.overlay1 = level.Content.Load<Texture2D>("Tiles/BreakOverlay1");
        }
예제 #6
0
        public Info(Level level, string message, Vector2 position)
        {
            this.level = level;
            this.Message = message;
            this.position = position;
            this.radius = 20;

            State = PowerState.Ground;

            LoadContent();
        }
예제 #7
0
파일: Animal.cs 프로젝트: BitSits/Gombli
        /// <summary>
        /// Constructs a new Animal.
        /// </summary>
        public Animal(Level level, Vector2 position, string spriteSet, 
            bool isFloating, bool isLazy, int playerDamage)
        {
            this.level = level;
            this.position = position;
            this.isFloating = isFloating;
            this.isLazy = isLazy;
            PlayerDamage = playerDamage;

            LoadContent(spriteSet);
        }
예제 #8
0
        public SlidingPuzzleBlock(Level level,Vector2 position, char number)
        {
            this.position = oriPosition = position;
            this.blockNumber = number - '0';

            this.destPositon = Level.InvalidPositionVector;
            State = PowerState.Ground;

            //if (this.blockNumber == 0) { puzzlePosition = position; State = PowerState.Pick; return; }

            texture = level.Content.Load<Texture2D>("SlidingPuzzle/" + number);
        }
예제 #9
0
파일: Enemy.cs 프로젝트: BitSits/Gombli
        /// <summary>
        /// Constructs a new Enemy.
        /// </summary>
        public Enemy(Level level, Vector2 position, string spriteSet, Orientation orientation,
            bool isPollutant, int contactDamage)
        {
            this.level = level;
            this.position = position;
            this.orientation = orientation;
            hurtTime = 0.0f;
            IsPollutant = isPollutant;

            PlayerDamage = contactDamage;

            PowerUpDamage = health = (float)contactDamage / 10;

            PointValue = contactDamage * 5;

            LoadContent(spriteSet);
        }
예제 #10
0
파일: BeanSeed.cs 프로젝트: BitSits/Gombli
 public BeanSeed(Level level, Vector2 position, bool playPick)
     : base(level, position)
 {
     PowerIndex = 1; Damage = 1f; this.playPick = playPick; LoadContent();
 }
예제 #11
0
 public RecycleBall(Level level, Vector2 position, bool playPick)
     : base(level, position)
 {
     PowerIndex = 3; Damage = 1.5f; health = 20000f; this.playPick = playPick; LoadContent();
 }
예제 #12
0
        private void LoadNextLevel(bool newLoading)
        {
            // Find the path of the next level.
            string levelPath;

            // Loop here so we can try again when we can't find a level.
            while (true)
            {
                // Try to find the next level. They are sequentially numbered txt files.
                levelPath = String.Format("Levels/{0}.txt", ++levelIndex);
                levelPath = Path.Combine(StorageContainer.TitleLocation, "Content/" + levelPath);
                if (File.Exists(levelPath))
                    break;

                // If there isn't even a level 0, something has gone wrong.
                if (levelIndex == 0)
                    throw new Exception("No levels found.");

                // Load main menu screen
                LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen());

                return;
            }

            // Unloads the content for the current level before loading the next one.
            if (level != null)
            {
                // save score and powerUps before loading Level is Disposed
                if (newLoading)
                {
                    totalScore = level.Score;

                    for (int i = 0; i < 4; i++)
                    { level.selectedPowerUpIndex = i; powerUpPicked[i] = level.SelectedPowerUpPicked; }
                }

                level.Dispose();
            }

            // Load the level.
            level = new Level(ScreenManager.Game.Services, levelPath, levelIndex, totalScore, powerUpPicked);

            exitTime = MaxExitTime;
            startTime = MaxStartTime;

            tempHealth = level.Player.CurrentHealth;
        }
예제 #13
0
파일: PowerUp.cs 프로젝트: BitSits/Gombli
 public PowerUp(Level level, Vector2 position)
 {
     this.Level = level;
     this.State = PowerState.Ground;
     this.position = position;
 }
예제 #14
0
파일: Marble.cs 프로젝트: BitSits/Gombli
 public Marble(Level level, Vector2 position, bool playPick)
     : base(level, position)
 {
     PowerIndex = 0; Damage = 0.4f; health = 0.1f; this.playPick = playPick; LoadContent();
 }
예제 #15
0
파일: Player.cs 프로젝트: BitSits/Gombli
        /// <summary>
        /// Constructors a new 
        /// </summary>
        public Player(Level level, Vector2 position)
        {
            this.level = level;
            CurrentHealth = MaxHealth;
            Direction = FaceDirection.Left;

            LoadContent();

            Reset(position);
        }