コード例 #1
0
ファイル: Pack.cs プロジェクト: DieselPuppet/DatingDash
        public Level AddLevel()
        {
            var level = new Level(this);
            Levels.Add(level);

            return level;
        }
コード例 #2
0
ファイル: RenderingEffect.cs プロジェクト: JacopoV/TimeJumper
 public RenderingEffect(ContentManager Content,Game game)
 {
     level = Content.ServiceProvider.GetService(typeof(Level)) as Level;
     dev = game.GraphicsDevice;
     pixel = new Texture2D(dev, 1, 1);
     pixel.SetData<Color>(new Color[] { Color.White });
     screenRect = new Rectangle(0, 0, dev.Viewport.Width, dev.Viewport.Height);
 }
コード例 #3
0
ファイル: RenderingBlocks.cs プロジェクト: JacopoV/TimeJumper
 public RenderingBlocks(ContentManager Content,Game game)
     : base(Content, game)
 {
     level = Content.ServiceProvider.GetService(typeof(Level)) as Level;
     block1 = Content.Load<Texture2D>("Tiles/block0-1");
     block2a = Content.Load<Texture2D>("Tiles/block0-2a");
     block2b = Content.Load<Texture2D>("Tiles/block0-2b");
     block2c = Content.Load<Texture2D>("Tiles/block0-2c");
 }
コード例 #4
0
ファイル: LayerEnemy.cs プロジェクト: JacopoV/TimeJumper
        public LayerEnemy(ContentManager content)
            : base(content)
        {
            level = content.ServiceProvider.GetService(typeof(Level)) as Level;
            enemyRunRed = new Animation(content.Load<Texture2D>("Sprites/MonsterA/RunEnemy"), 0.1f, true);
            enemyIdleRed = new Animation(content.Load<Texture2D>("Sprites/MonsterA/Idle"), 0.15f, true);
            electr = new Animation(content.Load<Texture2D>("Sprites/fulmine"), 0.15f, true,32);

            bladeRun = new Animation(content.Load<Texture2D>("Sprites/Guill"), 0.1f, true);
            thorns = new Animation(content.Load<Texture2D>("Sprites/Thorns"), 0.1f, true);

            Initialize();
        }
コード例 #5
0
ファイル: LayerPlayer.cs プロジェクト: JacopoV/TimeJumper
        public LayerPlayer(ContentManager content)
            : base(content)
        {
            level = content.ServiceProvider.GetService(typeof(Level)) as Level;
            playerIdle = new Animation(content.Load<Texture2D>("Sprites/Player/Idle"), 0.1f, true);
            playerRun = new Animation(content.Load<Texture2D>("Sprites/Player/player"), 0.03f, true);
            playerWalk = new Animation(content.Load<Texture2D>("Sprites/Player/player"), 0.07f, true);
            playerJump = new Animation(content.Load<Texture2D>("Sprites/Player/jumpPlayer"), 0.1f, false);
            playerWin = new Animation(content.Load<Texture2D>("Sprites/Player/player"), 0.1f, false);
            playerDie = new Animation(content.Load<Texture2D>("Sprites/Player/Die"), 0.1f, false);

            //set default animation sprite
            level.playerLevel.sprite.PlayAnimation(playerIdle);
        }
コード例 #6
0
ファイル: LayerGameObject.cs プロジェクト: JacopoV/TimeJumper
        public LayerGameObject(ContentManager content)
        {
            level = content.ServiceProvider.GetService(typeof(Level)) as Level;
            portal = new Animation(content.Load<Texture2D>("Sprites/portal"), 0.32f, true);

            doorClose = new Animation(content.Load<Texture2D>("Sprites/doorClose"), 0.1f, false);
            pass1 = new Animation(content.Load<Texture2D>("Sprites/pass1"), 0.1f, false);
            passClose1 = new Animation(content.Load<Texture2D>("Sprites/passClose1"), 0.1f, false);
            pass2 = new Animation(content.Load<Texture2D>("Sprites/pass2"), 0.1f, false);
            passClose2 = new Animation(content.Load<Texture2D>("Sprites/passClose2"), 0.1f, false);
            pass3 = new Animation(content.Load<Texture2D>("Sprites/pass3"), 0.1f, false);
            passClose3 = new Animation(content.Load<Texture2D>("Sprites/passClose3"), 0.1f, false);
            openDoor = new Animation(content.Load<Texture2D>("Sprites/Player/Die"), 0.1f, false);

            handle1 = new Animation(content.Load<Texture2D>("Sprites/handle1"), 0.1f, false);
            handle2 = new Animation(content.Load<Texture2D>("Sprites/handle2"), 0.1f, false);
            handle3 = new Animation(content.Load<Texture2D>("Sprites/handle3"), 0.1f, false);

            Initialize();
        }
コード例 #7
0
ファイル: SoundManager.cs プロジェクト: JacopoV/TimeJumper
        public SoundManager(ContentManager content)
        {
            rand = new Random();
            level = content.ServiceProvider.GetService(typeof(Level)) as Level;

            jump = content.Load<SoundEffect>("Sounds/PlayerJump").CreateInstance();
            diePlayer = content.Load<SoundEffect>("Sounds/PlayerKilled").CreateInstance();
            goodSwitch = content.Load<SoundEffect>("Sounds/goodSwitch").CreateInstance();
            badSwitch = content.Load<SoundEffect>("Sounds/badSwitch").CreateInstance();

            if (level.numLevel > 3)
            {
                music[0] = content.Load<SoundEffect>("Sounds/s2").CreateInstance();
                music[1] = content.Load<SoundEffect>("Sounds/h2").CreateInstance();
            }
            else
            {
                music[0] = content.Load<SoundEffect>("Sounds/s1").CreateInstance();
                music[1] = content.Load<SoundEffect>("Sounds/h1").CreateInstance();
            }

            openDoor = content.Load<SoundEffect>("Sounds/openDoor").CreateInstance();
            door = (content.Load<SoundEffect>("Sounds/door")).CreateInstance();
            nextLevel = content.Load<SoundEffect>("Sounds/ExitReached").CreateInstance();
            keyCollected = content.Load<SoundEffect>("Sounds/GemCollected").CreateInstance();

            openDoor.Volume = 0.5f;
            door.Volume = 0.5f;
            diePlayer.Volume = 0.5f;

            cameraListener = new AudioListener();
            cameraListener.Position =
                new Vector3(
                    GraphicsDeviceManager.DefaultBackBufferWidth / 2,
                    GraphicsDeviceManager.DefaultBackBufferHeight / 2,
                    0);
            isSoundActive = true;
        }
コード例 #8
0
ファイル: Pack.cs プロジェクト: DieselPuppet/DatingDash
        private void LoadTemplate(string xml)
        {
            if (LevelTemplate != null && !_hasTemplateErrors)
                return;

            if (LevelTemplate == null)
                Log.Write("Loading template...");
            else
                Log.Write("Reloading template (previous attempt failed)...");

            try
            {
                if (xml.IsNullOrWhiteSpace())
                    throw new CommonException("Level template is empty");

                var docTemplate = new XmlDocument();
                docTemplate.LoadXml(xml);

                TaskConfig = new TaskConfig(docTemplate.DocumentElement);
                SpawnItemConfig = new SpawnItemConfig(docTemplate.DocumentElement);
                LevelTemplate = new Level(this, docTemplate.DocumentElement["Level"], true);

                _hasTemplateErrors = false;
            }
            catch (Exception ex)
            {
                // ��������� ������, ���� �� ������� �������� �� �����
                if (TaskConfig == null)
                    TaskConfig = new TaskConfig(new string[1], new string[1]);

                if (LevelTemplate == null)
                    LevelTemplate = new Level(this, true);

                if (SpawnItemConfig == null)
                    SpawnItemConfig = new SpawnItemConfig();

                _hasTemplateErrors = true;

                Log.Write("Error while loading level template: {0}", ex.Message);
            }
        }
コード例 #9
0
 public RenderingGameObject(ContentManager Content,Game game)
     : base(Content,game)
 {
     level = Content.ServiceProvider.GetService(typeof(Level)) as Level;
 }
コード例 #10
0
 //update service when load a next level
 public void UpdateLevelService(ContentManager content)
 {
     level = content.ServiceProvider.GetService(typeof(Level)) as Level;
     base.UpdateLevelService(content);
 }
コード例 #11
0
 public static void LoadIntoLevel( LEVEL_NUM num )
 {
     m_levelNo = num;
     Level l = BinaryLoader.LoadLevel(num);
     m_levelData = l;
     m_currentLevelSpeed = m_levelData.speed;
 }
コード例 #12
0
ファイル: LayerGameObject.cs プロジェクト: JacopoV/TimeJumper
 //update the service whrn load the next level
 public void UpdateLevelService(ContentManager content)
 {
     level = content.ServiceProvider.GetService(typeof(Level)) as Level;
     Initialize();
 }
コード例 #13
0
ファイル: RenderingBlocks.cs プロジェクト: JacopoV/TimeJumper
 //update service when load a next level
 public void UpdateLevelService(ContentManager content)
 {
     level = content.ServiceProvider.GetService(typeof(Level)) as Level;
     //block1 = content.Load<Texture2D>("Tiles/block" + level.numLevel.ToString() + "-1");
     //block2a = content.Load<Texture2D>("Tiles/block" + level.numLevel.ToString() + "-2a");
     //block2b = content.Load<Texture2D>("Tiles/block" + level.numLevel.ToString() + "-2b");
     base.UpdateLevelService(content);
 }
コード例 #14
0
ファイル: RenderingPlayer.cs プロジェクト: JacopoV/TimeJumper
 public RenderingPlayer(ContentManager Content,Game game)
     : base(Content,game)
 {
     level = Content.ServiceProvider.GetService(typeof(Level)) as Level;
     play.PlayAnimation(playerDie);
 }
コード例 #15
0
ファイル: SoundManager.cs プロジェクト: JacopoV/TimeJumper
        //update service whene load the next level
        public void UpdateLevelService(ContentManager content)
        {
            level = content.ServiceProvider.GetService(typeof(Level)) as Level;
            float temp = rand.Next(4);

            music[0].Stop();
            music[1].Stop();
            System.Threading.Thread.Sleep(10);
            if (level.numLevel > 2)
            {
                music[0] = content.Load<SoundEffect>("Sounds/s2").CreateInstance();
                music[1] = content.Load<SoundEffect>("Sounds/h2").CreateInstance();
            }
            else
            {
                music[0] = content.Load<SoundEffect>("Sounds/s1").CreateInstance();
                music[1] = content.Load<SoundEffect>("Sounds/h1").CreateInstance();
            }
            music[0].Play();
            music[1].Play();
        }
コード例 #16
0
ファイル: Pack.cs プロジェクト: DieselPuppet/DatingDash
        public Level InsertLevel(int index)
        {
            var level = new Level(this);
            Levels.Insert(index, level);

            return level;
        }
コード例 #17
0
ファイル: GameState.cs プロジェクト: JacopoV/TimeJumper
 public GameState(ContentManager content)
     : base(content)
 {
     level = content.ServiceProvider.GetService(typeof(Level)) as Level;
 }