コード例 #1
0
ファイル: Tombstone.cs プロジェクト: Cur10s1ty/project2
        public Tombstone(Creature source)
        {
            currentLevel = Game1.GetInstance().currentLevel;
            int chance = currentLevel.random.Next(4);

            switch (chance)
            {
                case 0:
                    this.texture = AkumaContentManager.stoneTex;
                    break;
                case 1:
                    this.texture = AkumaContentManager.stoneTex2;
                    break;
                case 2:
                    this.texture = AkumaContentManager.stoneTex3;
                    break;
                case 3:
                    this.texture = AkumaContentManager.stoneTex4;
                    break;
                default:
                    this.texture = AkumaContentManager.stoneTex;
                    break;
            }

            if (source is Deer)
            {
                Deer deer = (Deer)source;
                location.X = deer.location.X;
                location.Y = currentLevel.levelHeight - texture.Height * scale - 2;
            }
        }
コード例 #2
0
ファイル: Tombstone.cs プロジェクト: Cur10s1ty/project2
        public Tombstone(Unit source)
        {
            currentLevel = Game1.GetInstance().currentLevel;
            int chance = currentLevel.random.Next(4);

            switch (chance)
            {
                case 0:
                    this.texture = AkumaContentManager.stoneTex;
                    break;
                case 1:
                    this.texture = AkumaContentManager.stoneTex2;
                    break;
                case 2:
                    this.texture = AkumaContentManager.stoneTex3;
                    break;
                case 3:
                    this.texture = AkumaContentManager.stoneTex4;
                    break;
                default:
                    this.texture = AkumaContentManager.stoneTex;
                    break;
            }

            if (source is DefaultEnemy)
            {
                DefaultEnemy enemy = (DefaultEnemy)source;
                if (enemy.falling || enemy.jumping)
                {
                    location.X = enemy.location.X;
                    location.Y = enemy.stopJumpOn + enemy.texture.Height - texture.Height * scale;
                }
                else
                {
                    location.X = enemy.location.X;
                    location.Y = currentLevel.levelHeight - texture.Height * scale - 2;
                }
            }
        }
コード例 #3
0
ファイル: AkumaViewport.cs プロジェクト: Cur10s1ty/project2
        public AkumaViewport(Level level)
        {
            game = Game1.GetInstance();

            switch (level.level)
            {
                case 1:
                    bg = new Background(Background.BGType.ForestTutorial);
                    break;

                case 2:
                    bg = new Background(Background.BGType.Forest);
                    break;

                case 3:
                    bg = new Background(Background.BGType.ForestArena);
                    break;
            }

            level.offset = new Vector2(0, 0);
            screenSize = new Vector2(800, 480);
        }
コード例 #4
0
ファイル: Game1.cs プロジェクト: Cur10s1ty/project2
        public void LoadIngameContent()
        {
            player = new Demon(0, 291);
            controller = new Controller();

            currentLevel = new Level(player, 1);
            currentLevel.GenerateLevel(currentLevel.level);
        }