Example #1
0
 public Particle(GameScene game, Vector position, Vector velocity)
 {
     this.game = game;
     this.position = position;
     this.velocity = velocity;
     removed = false;
 }
Example #2
0
 public PlayerFlame(GameScene game, Vector position, double direction, bool blackPlayer)
     : base(game, RADIUS, position, Vector.Zero, 4)
 {
     this.velocity = SPEED * new Vector(Math.Cos(direction / 180.0 * Math.PI), Math.Sin(direction / 180.0 * Math.PI));
     this.direction = direction;
     animation = 0;
 }
Example #3
0
File: Map.cs Project: sinshu/chaos
 public Map(GameScene game, int numRows, int numCols, string[] data)
 {
     this.game = game;
     this.numRows = numRows;
     this.numCols = numCols;
     blocks = new int[numRows, numCols];
     for (int row = 0; row < numRows; row++)
     {
         for (int col = 0; col < numCols; col++)
         {
             int index = BLOCK_CHARACTERS.IndexOf(data[row][col]);
             if (index == -1)
             {
                 if (data[row][col] == '!')
                 {
                     blocks[row, col] = BLOCK_ENEMYS;
                 }
                 else
                 {
                     blocks[row, col] = 0;
                 }
             }
             else
             {
                 blocks[row, col] = index;
             }
         }
     }
 }
Example #4
0
 public PlayerBullet2(GameScene game, Vector position, int direction, bool blackPlayer)
     : base(game, RADIUS, position, Vector.Zero, 3)
 {
     this.direction = (double)direction + 3.0 * game.Random.NextDouble() - 1.5;
     this.velocity = 12 * new Vector(Math.Cos(this.direction / 180.0 * Math.PI), Math.Sin(this.direction / 180.0 * Math.PI));
     life = int.MaxValue;
     animation = 0;
 }
Example #5
0
 public BossMushroom(GameScene game)
     : base(game, RECTANGLE, POSITION[0], Vector.Zero, INIT_HEALTH)
 {
     currentPos = 0;
     stateCount = 0;
     animation = 0;
     numDeathTicks = 0;
 }
Example #6
0
 public PlayerBullet(GameScene game, Vector position, int direction, bool blackPlayer)
     : base(game, RADIUS, position, Vector.Zero, 3)
 {
     this.velocity = 0.5 * SPEED * new Vector(Math.Cos((double)direction / 180.0 * Math.PI), Math.Sin((double)direction / 180.0 * Math.PI));
     this.direction = direction;
     life = int.MaxValue;
     animation = 0;
 }
Example #7
0
 public PlayerBullet3(GameScene game, Vector position, double direction, double speed, bool blackPlayer)
     : base(game, RADIUS, position, Vector.Zero, 1)
 {
     this.direction = direction;
     this.velocity = speed * new Vector(Math.Cos(this.direction / 180.0 * Math.PI), Math.Sin(this.direction / 180.0 * Math.PI));
     life = 8;
     animation = 0;
 }
Example #8
0
 public EggMachine(GameScene game, int row, int col, Direction direction)
     : base(game, RECTANGLE, new Vector(col * Settings.BLOCK_WDITH, row * Settings.BLOCK_WDITH), Vector.Zero, int.MaxValue)
 {
     this.direction = direction;
     idle = true;
     moveCount = 0;
     animation = 0;
 }
Example #9
0
 public Skater(GameScene game, int row, int col, Direction direction)
     : base(game, RECTANGLE, new Vector(col * Settings.BLOCK_WDITH, row * Settings.BLOCK_WDITH), Vector.Zero, INIT_HEALTH)
 {
     this.direction = direction;
     stateCount = 0;
     stateCount2 = 0;
     flipAnimation = false;
 }
Example #10
0
File: Worm.cs Project: sinshu/chaos
 public Worm(GameScene game, int row, int col, Direction direction)
     : base(game, RECTANGLE, new Vector(col * Settings.BLOCK_WDITH, row * Settings.BLOCK_WDITH), Vector.Zero, INIT_HEALTH)
 {
     this.direction = direction;
     stateCount = game.Random.Next(30, 60);
     running = true;
     animation = 0;
 }
Example #11
0
File: Worm.cs Project: sinshu/chaos
 public Worm(GameScene game, Vector position)
     : base(game, new Rectangle(new Vector(8, 24), new Vector(16, 8)), position, Vector.Zero, INIT_HEALTH / 2)
 {
     direction = game.Random.Next(0, 2) == 0 ? Direction.Left : Direction.Right;
     stateCount = game.Random.Next(30, 60);
     running = true;
     animation = 0;
 }
Example #12
0
 public StarmanBullet(GameScene game, Vector position, Starman.Direction direction, double x)
     : base(game, RADIUS, position, new Vector(direction == Starman.Direction.Left ? -1 : 1, 0), DAMAGE)
 {
     this.direction = direction;
     baseHeight = position.Y;
     count = 0;
     this.x = x;
 }
Example #13
0
 public AtField(GameScene game, Direction direction, Baaka parent)
     : base(game, RECTANGLE, direction == Direction.Left ? parent.Center + new Vector(-32 - 16, -64) : parent.Center + new Vector(32 - 16, -64), Vector.Zero, INIT_HEALTH)
 {
     this.direction = direction;
     this.parent = parent;
     animation = 0;
     previousHealth = health;
     energy = 192;
 }
Example #14
0
 public House(GameScene game, int row, int col, Direction direction)
     : base(game, RECTANGLE, new Vector(col * Settings.BLOCK_WDITH, row * Settings.BLOCK_WDITH), Vector.Zero, INIT_HEALTH)
 {
     this.direction = direction;
     currentState = State.Sleep;
     openCount = 0;
     attackCount = 0;
     animation = 0;
 }
Example #15
0
 public RobotRocket(GameScene game, Vector position, int direction, double rotate)
     : base(game, RADIUS, position, Vector.Zero, DAMAGE)
 {
     this.direction = direction;
     speed = 8;
     this.rotate = rotate;
     life = 120 - (int)Math.Round(15 * rotate);
     animation = 0;
 }
Example #16
0
 public KyoroRocket(GameScene game, Vector position, int direction, bool blackPlayer)
     : base(game, RADIUS, position, Vector.Zero, DAMAGE)
 {
     this.direction = direction;
     speed = 0;
     life = 600;
     maxRotAngle = 0.125;
     animation = 0;
 }
Example #17
0
 public Bullet(GameScene game, double radius, Vector position, Vector velocity, int damage)
 {
     this.game = game;
     this.radius = radius;
     this.position = position;
     this.velocity = velocity;
     this.damage = damage;
     removed = false;
 }
Example #18
0
        public PlayerFlame(GameScene game, Vector position, double direction)
            : base(game, RADIUS, position, Vector.Zero, 4)
        {
            this.velocity = SPEED * new Vector(Math.Cos(direction / 180.0 * Math.PI), Math.Sin(direction / 180.0 * Math.PI));
            this.direction = direction;
            animation = 0;

            if (game.DebugMode) damage *= 8;
        }
Example #19
0
 public ExitDoor(GameScene game, int row, int col)
 {
     this.game = game;
     position.X = col * Settings.BLOCK_WDITH;
     position.Y = row * Settings.BLOCK_WDITH;
     visible = false;
     playerExited = false;
     fadeCount = 0;
     slideCount = 0;
 }
Example #20
0
 public ItemEnemy(GameScene game, int row, int col, Direction direction, Item item)
     : base(game, RECTANGLE, new Vector(col * Settings.BLOCK_WDITH, row * Settings.BLOCK_WDITH), Vector.Zero, INIT_HEALTH)
 {
     this.direction = direction;
     this.item = item;
     animation = 0;
     moveCount = 0;
     moveCount2 = 0;
     jumping = false;
 }
Example #21
0
 public Hanabi(GameScene game, Vector explosion, bool big, int colorIndex)
     : base(game, new Vector(explosion.X, 512), new Vector(0, -8))
 {
     explodeY = explosion.Y;
     exploding = false;
     animation = -1;
     this.big = big;
     this.colorIndex = colorIndex;
     flip = game.Random.Next(0, 2) == 0;
 }
Example #22
0
File: Babo.cs Project: sinshu/chaos
 public Babo(GameScene game, int row, int col, Direction direction)
     : base(game, RECTANGLE, new Vector(col * Settings.BLOCK_WDITH, row * Settings.BLOCK_WDITH), Vector.Zero, INIT_HEALTH)
 {
     this.direction = direction;
     canJump = false;
     normalJump = false;
     attackJump = false;
     jumpCount = 60;
     animation = 0;
 }
Example #23
0
        public PlayerRocket(GameScene game, Vector position, int direction)
            : base(game, RADIUS, position, Vector.Zero, DAMAGE)
        {
            this.direction = direction;
            speed = 0;
            life = 48;
            animation = 0;

            if (game.DebugMode) damage *= 8;
        }
Example #24
0
        public PlayerBullet3(GameScene game, Vector position, double direction, double speed)
            : base(game, RADIUS, position, Vector.Zero, DAMAGE)
        {
            this.direction = direction;
            this.velocity = speed * new Vector(Math.Cos(this.direction / 180.0 * Math.PI), Math.Sin(this.direction / 180.0 * Math.PI));
            life = 8;
            animation = 0;

            if (game.DebugMode) damage *= 8;
        }
Example #25
0
        public PlayerBullet2(GameScene game, Vector position, int direction)
            : base(game, RADIUS, position, Vector.Zero, DAMAGE)
        {
            this.direction = (double)direction + 6.0 * game.Random.NextDouble() - 3.0;
            this.velocity = SPEED * new Vector(Math.Cos(this.direction / 180.0 * Math.PI), Math.Sin(this.direction / 180.0 * Math.PI));
            life = 40;
            animation = 0;

            if (game.DebugMode) damage *= 8;
        }
Example #26
0
 public Kyoro(GameScene game, int row, int col, Direction direction)
     : base(game, RECTANGLE, new Vector(col * Settings.BLOCK_WDITH, row * Settings.BLOCK_WDITH), Vector.Zero, INIT_HEALTH)
 {
     this.direction = direction;
     playerDetected = false;
     attacking = false;
     attackCount = 0;
     attackCount2 = 0;
     playerRange = 256;
     animation = 0;
 }
Example #27
0
 public Mushroom(GameScene game, Vector position)
     : base(game, new Rectangle(new Vector(8, 24), new Vector(16, 8)), position, Vector.Zero, INIT_HEALTH / 2)
 {
     direction = game.Random.Next(0, 2) == 0 ? Direction.Left : Direction.Right;
     currentState = State.Rise;
     attackCount = 0;
     attackCount2 = 0;
     angle = 270;
     animation = 0;
     aggressive = true;
 }
Example #28
0
 public Father(GameScene game, int row, int col)
     : base(game, RECTANGLE, new Vector(col * Settings.BLOCK_WDITH, row * Settings.BLOCK_WDITH), Vector.Zero, INIT_HEALTH)
 {
     baseHeight = position.Y;
     basePos = position;
     targetPos = position;
     stateCount = 0;
     teleporting = false;
     attacking = false;
     wideAttack = false;
     numDeathTicks = 0;
 }
Example #29
0
 public Robot(GameScene game, int row, int col, Direction direction)
     : base(game, RECTANGLE1, new Vector(col * Settings.BLOCK_WDITH, row * Settings.BLOCK_WDITH), Vector.Zero, INIT_HEALTH)
 {
     velocity.X = game.Random.Next(0, 2) == 0 ? 1 : -1;
     this.direction = direction;
     moveCount = 60;
     attackCount = 0;
     attackCount2 = 120;
     jumpCount = 0;
     currentState = State.Run;
     animation = 0;
 }
Example #30
0
 public PlayerRocketTail(GameScene game, Vector position, Vector velocity, int animation)
     : this(game, position, velocity)
 {
     if (animation == 32)
     {
         this.animation = 31;
     }
     else
     {
         this.animation = animation;
     }
 }
Example #31
0
 public Map GetMap(GameScene game)
 {
     return(new Map(game, numRows, numCols, mapData));
 }
Example #32
0
        private Thing CreateEnemyFromData(string[] thingData, GameScene game)
        {
            try
            {
                switch (thingData[0])
                {
                case "TestEnemy":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のTestEnemyの位置の指定がおかしいです><");
                    }
                    TestEnemy.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = TestEnemy.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = TestEnemy.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のTestEnemyの向きの指定がおかしいです><");
                    }
                    return(new TestEnemy(game, row, col, direction));
                }

                case "House":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のHouseの位置の指定がおかしいです><");
                    }
                    House.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = House.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = House.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のHouseの向きの指定がおかしいです><");
                    }
                    return(new House(game, row, col, direction));
                }

                case "Baaka":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のBaakaの位置の指定がおかしいです><");
                    }
                    Baaka.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = Baaka.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = Baaka.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のBaakaの向きの指定がおかしいです><");
                    }
                    return(new Baaka(game, row, col, direction));
                }

                case "Babo":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のBaboの位置の指定がおかしいです><");
                    }
                    Babo.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = Babo.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = Babo.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のBaboの向きの指定がおかしいです><");
                    }
                    return(new Babo(game, row, col, direction));
                }

                case "Kyoro":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のKyoroの位置の指定がおかしいです><");
                    }
                    Kyoro.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = Kyoro.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = Kyoro.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のKyoroの向きの指定がおかしいです><");
                    }
                    return(new Kyoro(game, row, col, direction));
                }

                case "Nurunuru":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のNurunuruの位置の指定がおかしいです><");
                    }
                    Nurunuru.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = Nurunuru.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = Nurunuru.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のNurunuruの向きの指定がおかしいです><");
                    }
                    return(new Nurunuru(game, row, col, direction));
                }

                case "Byaa":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のByaaの位置の指定がおかしいです><");
                    }
                    Byaa.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = Byaa.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = Byaa.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のByaaの向きの指定がおかしいです><");
                    }
                    return(new Byaa(game, row, col, direction));
                }

                case "ItemEnemy":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のItemEnemyの位置の指定がおかしいです><");
                    }
                    ItemEnemy.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = ItemEnemy.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = ItemEnemy.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のItemEnemyの向きの指定がおかしいです><");
                    }
                    switch (thingData[4])
                    {
                    case "Machinegun":
                        return(new ItemEnemy(game, row, col, direction, ItemEnemy.Item.Machinegun));

                    case "Rocket":
                        return(new ItemEnemy(game, row, col, direction, ItemEnemy.Item.Rocket));

                    case "Shotgun":
                        return(new ItemEnemy(game, row, col, direction, ItemEnemy.Item.Shotgun));

                    case "Flame":
                        return(new ItemEnemy(game, row, col, direction, ItemEnemy.Item.Flame));

                    case "Health":
                        return(new ItemEnemy(game, row, col, direction, ItemEnemy.Item.Health));

                    default:
                        throw new Exception("ステージデータ「" + path + "」のItemEnemyのアイテムの指定がおかしいです><");
                    }
                }

                case "Norio":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のNorioの位置の指定がおかしいです><");
                    }
                    Norio.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = Norio.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = Norio.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のNorioの向きの指定がおかしいです><");
                    }
                    return(new Norio(game, row, col, direction));
                }

                case "Mushroom":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のMushroomの位置の指定がおかしいです><");
                    }
                    Mushroom.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = Mushroom.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = Mushroom.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のMushroomの向きの指定がおかしいです><");
                    }
                    bool visible;
                    if (thingData[4] == "Visible")
                    {
                        visible = true;
                    }
                    else if (thingData[4] == "Invisible")
                    {
                        visible = false;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のMushroomの可視設定がおかしいです><");
                    }
                    return(new Mushroom(game, row, col, direction, visible));
                }

                case "Robot":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のRobotの位置の指定がおかしいです><");
                    }
                    Robot.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = Robot.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = Robot.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のRobotの向きの指定がおかしいです><");
                    }
                    return(new Robot(game, row, col, direction));
                }

                case "Skater":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のSkaterの位置の指定がおかしいです><");
                    }
                    Skater.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = Skater.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = Skater.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のSkaterの向きの指定がおかしいです><");
                    }
                    return(new Skater(game, row, col, direction));
                }

                case "BlackPlayer":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のBlackPlayerの位置の指定がおかしいです><");
                    }
                    BlackPlayer.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = BlackPlayer.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = BlackPlayer.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のBlackPlayerの向きの指定がおかしいです><");
                    }
                    switch (thingData[4])
                    {
                    case "Pistol":
                        return(new BlackPlayer(game, row, col, direction, BlackPlayer.Weapon.Pistol));

                    case "Machinegun":
                        return(new BlackPlayer(game, row, col, direction, BlackPlayer.Weapon.Machinegun));

                    case "Rocket":
                        return(new BlackPlayer(game, row, col, direction, BlackPlayer.Weapon.Rocket));

                    case "Shotgun":
                        return(new BlackPlayer(game, row, col, direction, BlackPlayer.Weapon.Shotgun));

                    case "Flame":
                        return(new BlackPlayer(game, row, col, direction, BlackPlayer.Weapon.Flamethrower));

                    default:
                        throw new Exception("ステージデータ「" + path + "」のBlackPlayerの武器の指定がおかしいです><");
                    }
                }

                case "Worm":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のWormの位置の指定がおかしいです><");
                    }
                    Worm.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = Worm.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = Worm.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のWormの向きの指定がおかしいです><");
                    }
                    return(new Worm(game, row, col, direction));
                }

                case "Starman":
                {
                    int row, col;
                    try
                    {
                        row = int.Parse(thingData[1]);
                        col = int.Parse(thingData[2]);
                    }
                    catch
                    {
                        throw new Exception("ステージデータ「" + path + "」のStarmanの位置の指定がおかしいです><");
                    }
                    Starman.Direction direction;
                    if (thingData[3] == "Left")
                    {
                        direction = Starman.Direction.Left;
                    }
                    else if (thingData[3] == "Right")
                    {
                        direction = Starman.Direction.Right;
                    }
                    else
                    {
                        throw new Exception("ステージデータ「" + path + "」のStarmanの向きの指定がおかしいです><");
                    }
                    return(new Starman(game, row, col, direction));
                }

                default:
                    return(null);
                }
            }
            catch (Exception e)
            {
                if (e is IndexOutOfRangeException)
                {
                    throw new Exception("ステージデータ「" + path + "」がおかしいです><");
                }
                else
                {
                    throw e;
                }
            }
        }
Example #33
0
 public HealthItemExplosion(GameScene game, Vector position, Vector velocity)
     : base(game, position, velocity)
 {
     animation = 0;
 }
Example #34
0
 public TestEnemy(GameScene game, int row, int col, Direction direction)
     : base(game, RECTANGLE, new Vector(col * Settings.BLOCK_WDITH, row * Settings.BLOCK_WDITH), Vector.Zero, INIT_HEALTH)
 {
     this.direction = direction;
     animation      = 0;
 }
Example #35
0
 public OyajiThunder(GameScene game, double x)
     : base(game, new Vector(x, game.Map.Height - 32), Vector.Zero)
 {
     animation = 0;
 }
Example #36
0
 public EggMachineBullet(GameScene game, Vector position, Vector velocity, bool isWormEgg)
     : base(game, RADIUS, position, velocity, DAMAGE)
 {
     this.isWormEgg = isWormEgg;
 }
Example #37
0
 public RocketItem(GameScene game, Vector position, Vector velocity)
     : base(game, position, velocity)
 {
     animation = 0;
 }
Example #38
0
 public PlayerRocketTail(GameScene game, Vector position, Vector velocity)
     : base(game, position, velocity)
 {
     animation = 0;
 }
Example #39
0
        public bool Tick()
        {
            switch (currentState)
            {
            case State.Title:
                title.Tick(inputDevice.CurrentTitleInput);
                if (title.CurrentState == TitleScene.State.StageSelect)
                {
                    currentState            = State.StageSelect;
                    stageSelect             = new StageSelectScene(numUnlockedStages, currentStageIndex);
                    stageSelect.AudioDevice = audioDevice;
                    return(true);
                }
                else if (title.CurrentState == TitleScene.State.GotoGame)
                {
                    title                   = null;
                    currentState            = State.Game;
                    currentStageIndex       = settings.StartStageIndex;
                    currentGame             = CreateGameScene(currentStageIndex);
                    currentGame.AudioDevice = audioDevice;
                    WriteLog("NewGame");
                    return(true);
                }
                else if (title.CurrentState == TitleScene.State.Exit)
                {
                    currentState = State.Exit;
                }
                break;

            case State.StageSelect:
                stageSelect.Tick(inputDevice.CurrentStageSelectInput);
                title.Tick(TitleInput.Empty);
                if (stageSelect.CurrentState == StageSelectScene.State.GotoGame)
                {
                    currentState            = State.Game;
                    currentStageIndex       = stageSelect.SelectedStage;
                    currentGame             = CreateGameScene(currentStageIndex);
                    currentGame.AudioDevice = audioDevice;
                    WriteLog("Continue (Stage " + (currentStageIndex + 1) + ")");
                    return(true);
                }
                else if (stageSelect.CurrentState == StageSelectScene.State.Exit)
                {
                    stageSelect  = null;
                    currentState = State.Title;
                    title.StageSelectExited();
                }
                break;

            case State.Game:
                if (inputDevice.DebugKey)
                {
                    currentGame.DebugMode = true;
                }
                currentGame.Tick(inputDevice.CurrentGameInput);
                if (currentGame.CurrentState == GameScene.State.Clear)
                {
                    if (currentStageIndex == NUM_STAGES - 1)
                    {
                        currentGame        = null;
                        currentState       = State.Ending;
                        ending             = new EndingScene();
                        ending.AudioDevice = audioDevice;
                        return(true);
                    }
                    currentStageIndex       = (currentStageIndex + 1) % NUM_STAGES;
                    currentGame             = CreateGameScene(currentStageIndex, currentGame.Player.State);
                    currentGame.AudioDevice = audioDevice;
                    if (numUnlockedStages < currentStageIndex + 1)
                    {
                        numUnlockedStages = currentStageIndex + 1;
                    }
                    return(true);
                }
                else if (currentGame.CurrentState == GameScene.State.Gameover)
                {
                    currentGame       = null;
                    currentState      = State.Title;
                    title             = new TitleScene(1, settings.ArcadeMode);
                    title.AudioDevice = audioDevice;
                    return(true);
                }
                break;

            case State.Ending:
                ending.Tick(inputDevice.CurrentEndingInput);
                if (ending.CurrentState == EndingScene.State.Exit)
                {
                    ending            = null;
                    currentState      = State.Title;
                    title             = new TitleScene(1, settings.ArcadeMode);
                    title.AudioDevice = audioDevice;
                    return(true);
                }
                break;
            }
            return(false);
        }
Example #40
0
 public ExitDoorForBossStage(GameScene game, int row, int col)
     : base(game, row, col)
 {
     delay = 256;
 }
Example #41
0
 public HouseBullet(GameScene game, Vector position, Vector velocity)
     : base(game, RADIUS, position, velocity, DAMAGE)
 {
 }
Example #42
0
 public PlayerBulletExplosion2(GameScene game, Vector position, Vector velocity)
     : base(game, position, velocity)
 {
     animation  = 0;
     flipRotate = game.Random.Next(0, 8);
 }
Example #43
0
 public FatherGhost(GameScene game, Vector position, Vector velocity, int color)
     : base(game, position, velocity)
 {
     animation  = 0;
     this.color = color;
 }
Example #44
0
 public PlayerFlameParticle(GameScene game, Vector position, Vector velocity)
     : base(game, position, velocity)
 {
     animation = 0;
 }
Example #45
0
 public MachinegunItem(GameScene game, Vector position, Vector velocity)
     : base(game, position, velocity)
 {
     animation = 0;
 }
Example #46
0
 public BlackDebris(GameScene game, Vector position, Vector velocity, int type)
     : base(game, position, velocity)
 {
     animation = 0;
     this.type = type;
 }
Example #47
0
 public BrokenAtField(GameScene game, Vector position, Vector velocity, int part)
     : base(game, position, velocity)
 {
     this.part = part;
     animation = 0;
 }
Example #48
0
 public MushroomSpore(GameScene game, Vector position, Vector velocity)
     : base(game, RADIUS, position, velocity, DAMAGE)
 {
 }
Example #49
0
 public BaakaBullet(GameScene game, Vector position, Vector velocity)
     : base(game, RADIUS, position, velocity, 3)
 {
 }
Example #50
0
 public Enemy(GameScene game, Rectangle rectangle, Vector position, Vector velocity, int health)
     : base(game, rectangle, position, velocity, health)
 {
 }
Example #51
0
 public Item(GameScene game, Vector position, Vector velocity)
     : base(game, new Rectangle(new Vector(4, 4), new Vector(24, 24)), position, velocity, 666)
 {
     MoveBy_Left(GameInput.Empty, 0);
     MoveBy_Right(GameInput.Empty, 0);
 }