Beispiel #1
0
 public KurageSpawner(Game game, double x, double y)
     : base(game, x, y)
 {
     this.angle = game.Random.Next(0, 360);
     animation = 0;
     type = game.Random.Next(0, 3);
 }
Beispiel #2
0
 public SnakeBody(Game game, double x, double y, bool tail)
     : base(game, x, y)
 {
     this.tail = tail;
     angle = 0;
     isDead = false;
 }
Beispiel #3
0
 public Snake(Game game, double x, double y)
     : base(game, x, y)
 {
     bodies = new SnakeBody[NUM_BODIES];
     for (int i = 0; i < NUM_BODIES; i++)
     {
         bodies[i] = new SnakeBody(game, x, y, i == 0);
     }
     posBufX = new double[POS_BUF_LEN_SUM];
     posBufY = new double[POS_BUF_LEN_SUM];
     angleBuf = new int[POS_BUF_LEN_SUM];
     for (int i = 0; i < POS_BUF_LEN_SUM; i++)
     {
         posBufX[i] = x;
         posBufY[i] = y;
         angleBuf[i] = 315;
     }
     px = x;
     py = y;
     vx = vy = 0;
     targetX = game.Random.Next(Game.FieldWidth / 2 - 192, Game.FieldWidth / 2 + 192 + 1);
     targetY = game.Random.Next(Game.FieldHeight / 4 - 64, Game.FieldHeight / 4 + 192 + 1);
     angle = 315;
     attackCount = game.Random.Next(90, 120);
     hitPoints = 32;
     damaged = false;
     isDying = false;
     dyingCount = 0;
 }
Beispiel #4
0
 public Missile(Game game, double x, double y, int angle)
     : base(game, x, y, 0, angle)
 {
     isDead = false;
     vx = vy = 0;
     ticks = 0;
 }
Beispiel #5
0
 public BigExplosionEffect(Game game, double x, double y, int angle, int r, int g, int b)
     : base(game, x, y)
 {
     this.angle = angle;
     this.r = r;
     this.g = g;
     this.b = b;
     animation = 0;
 }
Beispiel #6
0
 public Player(Game game, double x, double y)
     : base(game, x, y)
 {
     vx = vy = 0;
     fireCount = 0;
     isDead = false;
     freeze = false;
     warpSpeed = 8;
 }
Beispiel #7
0
 public SnakeBullet(Game game, double x, double y, double speed, int angle)
     : base(game, x, y, speed, angle)
 {
     isDead = false;
     spin = game.Random.Next(4, 17);
     if (game.Random.Next(0, 2) == 0)
     {
         spin = -spin;
     }
     dirr = game.Random.Next(0, 360);
 }
Beispiel #8
0
 public Borg(Game game, double x, double y)
     : base(game, x, y)
 {
     angle = 90;
     vx = vy = 0;
     waitCount = game.Random.Next(15, 30);
     waitX = x;
     waitY = y;
     swingWidth = (x - Game.FieldWidth / 2) / 8;
     swingHeight = (y - 48) / 16;
     hitPoints = 16;
     damaged = false;
 }
Beispiel #9
0
 public GreenEnemy(Game game, double x, double y)
     : base(game, x, y)
 {
     isDead = false;
     angle = 90;
     vx = vy = 0;
     waitCount = game.Random.Next(15, 120);
     waitX = x;
     waitY = y;
     swingWidth = (x - Game.FieldWidth / 2) / 8;
     swingHeight = (y - 48) / 16;
     playerXTraceOffset = game.Random.Next(-64, 64 + 1);
     fireCount = game.Random.Next(30, 60);
 }
Beispiel #10
0
 public Mushi(Game game, double x, double y, int type)
     : base(game, x, y)
 {
     isDead = false;
     angle = 90;
     vx = vy = 0;
     waitCount = game.Random.Next(15, 120);
     waitX = x;
     waitY = y;
     swingWidth = (x - Game.FieldWidth / 2) / 8;
     swingHeight = (y - 48) / 16;
     this.type = type;
     animation = 0;
 }
Beispiel #11
0
 public FirstBoss(Game game, double x, double y)
     : base(game, x, y)
 {
     targetX = Game.FieldWidth / 2;
     targetY = Game.FieldHeight / 4;
     x2 = X;
     y2 = y;
     moveCount = game.Random.Next(30, 60);
     attackMode = 0;
     hitPoints = 96;
     damaged = false;
     isDying = false;
     dyingCount = 0;
 }
Beispiel #12
0
 public LastBoss(Game game, double x, double y)
     : base(game, x, y)
 {
     targetX = Game.FieldWidth / 2;
     targetY = Game.FieldHeight / 4;
     x2 = X;
     y2 = y;
     moveCount = game.Random.Next(30, 60);
     spawnEnemyType = 0;
     hitPoints = 192;
     damaged = false;
     isDying = false;
     dyingCount = 0;
     animation = 0;
 }
Beispiel #13
0
 public Teki(Game game, double x, double y, int type)
     : base(game, x, y)
 {
     angle = 90;
     vx = vy = 0;
     waitCount = game.Random.Next(15, 120);
     waitX = x;
     waitY = y;
     swingWidth = (x - Game.FieldWidth / 2) / 8;
     swingHeight = (y - 48) / 16;
     playerXTraceOffset = game.Random.Next(-128, 128 + 1);
     fireCount = game.Random.Next(30, 60);
     attacking = false;
     this.type = type;
     hitPoints = 2;
 }
Beispiel #14
0
 public EndingMessage(Game game, double x, double y, string[] message)
     : base(game, x, y)
 {
     this.message = message;
     hitPoints = 16;
     int maxWidth = 0;
     foreach (string s in message)
     {
         if (s.Length * 16 > maxWidth)
         {
             maxWidth = s.Length * 16;
         }
     }
     width = maxWidth;
     height = message.Length * 16;
 }
Beispiel #15
0
 public OrangeEnemy(Game game, double x, double y)
     : base(game, x, y)
 {
     angle = 90;
     vx = vy = 0;
     waitCount = game.Random.Next(15, 120);
     waitX = x;
     waitY = y;
     swingWidth = (x - Game.FieldWidth / 2) / 8;
     swingHeight = (y - 48) / 16;
     playerXTraceOffset = game.Random.Next(-96, 96 + 1);
     fireCount = game.Random.Next(30, 60);
     attacking = false;
     hitPoints = 2;
     damaged = false;
 }
Beispiel #16
0
 public Clipper(Game game, double x, double y)
     : base(game, x, y)
 {
     shieldPhase = 0;
     shieldRadius = 128;
     targetRadius = 128;
     funnels = new Funnel[NUM_FUNNEL];
     for (int i = 0; i < NUM_FUNNEL; i++)
     {
         double fx = x + Utility.Cos(shieldPhase + 360 / NUM_FUNNEL * i) * shieldRadius;
         double fy = y - Utility.Sin(shieldPhase + 360 / NUM_FUNNEL * i) * shieldRadius / 2;
         funnels[i] = new Funnel(game, fx, fy);
     }
     moveCount = game.Random.Next(30, 45);
     targetX = game.Random.Next(Game.FieldWidth / 2 - 192, Game.FieldWidth / 2 + 192 + 1);
     targetY = game.Random.Next(Game.FieldHeight / 4 - 64, Game.FieldHeight / 4 + 64 + 1);
     attackCount = game.Random.Next(30, 60);
     hitPoints = 32;
     damaged = false;
     isDead = false;
     animation = 0;
 }
Beispiel #17
0
        public GameManager(IAudio audio, int startLevel)
        {
            status = GameManagerStatus.None;
            random = new Random();
            title = null;
            game = null;
            gameOver = null;
            ranking = null;
            level = 0;
            currentScore = 0;
            playerLeft = 0;
            bossEndCount = 0;
            top10Players = new TopPlayerInfo[10];

            this.startLevel = startLevel;

            for (int i = 0; i < 10; i++)
            {
                top10Players[i] = new TopPlayerInfo((10 - i) * 1000, 10 - i, "_NONAME_");
            }
            exiting = false;

            this.audio = audio;
        }
Beispiel #18
0
 public PlayerBullet(Game game, double x, double y, double speed, int angle)
     : base(game, x, y, speed, angle)
 {
     isDead = false;
 }
Beispiel #19
0
 public EndingMessage3(Game game)
     : base(game, -128, Game.FieldHeight / 4, new string[] { "SOUND EFFECTS", "", "HA810" })
 {
 }
Beispiel #20
0
 public Bullet(Game game, double x, double y, double speed, int angle)
     : base(game, x, y)
 {
     this.speed = speed;
     this.angle = angle;
 }
Beispiel #21
0
 public Smoke(Game game, double x, double y, int angle)
     : base(game, x, y)
 {
     this.angle = angle;
     animation = 0;
 }
Beispiel #22
0
 public Funnel(Game game, double x, double y)
     : base(game, x, y)
 {
 }
Beispiel #23
0
 public SmallExplosionEffect(Game game, double x, double y, int angle)
     : base(game, x, y)
 {
     this.angle = angle;
     animation = game.Random.Next(0, 2);
 }
Beispiel #24
0
 public GameObject(Game game, double x, double y)
 {
     this.game = game;
     this.x = x;
     this.y = y;
 }
Beispiel #25
0
 public Effect(Game game, double x, double y)
     : base(game, x, y)
 {
 }
Beispiel #26
0
 public EndingMessage6(Game game)
     : base(game, Game.FieldWidth + 128, Game.FieldHeight / 4, new string[] { "", "THANK YOU FOR PLAYING", ""})
 {
 }
Beispiel #27
0
 public void Update(IInput input)
 {
     switch (status)
     {
         case GameManagerStatus.None:
             title = new Title(random);
             status = GameManagerStatus.Title;
             audio.PlayMusic(Music.Title);
             break;
         case GameManagerStatus.Title:
             title.Update(input.UserCommand);
             if (title.ExitGame)
             {
                 exiting = true;
             }
             else if (title.StartGame)
             {
                 title = null;
                 level = startLevel;
                 currentScore = 0;
                 playerLeft = INIT_PLAYER_LEFT;
                 game = Game.CreateGame(random, level, top10Players[0].Score, currentScore, playerLeft);
                 status = GameManagerStatus.Game;
                 if (!game.IsBossStage)
                 {
                     audio.PlayMusic(Music.Game);
                 }
                 else
                 {
                     audio.PlayMusic(Music.Boss);
                 }
             }
             else if (title.Ranking)
             {
                 title = null;
                 ranking = new Ranking(top10Players, random);
                 status = GameManagerStatus.Ranking;
             }
             break;
         case GameManagerStatus.Game:
             game.Update(input.GameCommand);
             foreach (Sound sound in game.CurrentSounds)
             {
                 audio.PlaySound(sound);
             }
             if (game.ReturnToTitle)
             {
                 game = null;
                 title = new Title(random);
                 status = GameManagerStatus.Title;
                 audio.PlayMusic(Music.Title);
             }
             else if (game.GameOver)
             {
                 if (playerLeft > 0)
                 {
                     currentScore = game.Score;
                     playerLeft--;
                     game = Game.CreateGame(random, level, top10Players[0].Score, currentScore, playerLeft);
                 }
                 else
                 {
                     currentScore = game.Score;
                     gameOver = new GameOver(currentScore > top10Players[9].Score, false);
                     status = GameManagerStatus.GameOver;
                     if (currentScore > top10Players[9].Score)
                     {
                         audio.PlayMusic(Music.NameEntry);
                     }
                     else
                     {
                         audio.StopMusic();
                     }
                 }
             }
             else if (game.GoingToNextStage)
             {
                 if (!game.IsBossStage)
                 {
                     currentScore = game.Score;
                     level++;
                     game = Game.CreateGame(random, level, top10Players[0].Score, currentScore, playerLeft);
                     if (game.IsBossStage)
                     {
                         audio.PlayMusic(Music.Boss);
                     }
                 }
                 else
                 {
                     bossEndCount = 0;
                     status = GameManagerStatus.BossEnd;
                     audio.StopMusic();
                 }
             }
             else if (game.EndingGameOver)
             {
                 currentScore = game.Score;
                 gameOver = new GameOver(currentScore > top10Players[9].Score, true);
                 status = GameManagerStatus.GameOver;
                 if (currentScore > top10Players[9].Score)
                 {
                     audio.PlayMusic(Music.NameEntry);
                 }
                 else
                 {
                     audio.StopMusic();
                 }
             }
             break;
         case GameManagerStatus.BossEnd:
             if (bossEndCount < 30)
             {
                 bossEndCount++;
             }
             if (bossEndCount == 30)
             {
                 currentScore = game.Score;
                 level++;
                 game = Game.CreateGame(random, level, top10Players[0].Score, currentScore, playerLeft);
                 status = GameManagerStatus.Game;
                 audio.PlayMusic(Music.Game);
             }
             break;
         case GameManagerStatus.GameOver:
             game.Update(GameCommand.Empty);
             gameOver.Update(input.UserCommand);
             foreach (Sound sound in gameOver.CurrentSounds)
             {
                 audio.PlaySound(sound);
             }
             if (gameOver.ReturnToTitle)
             {
                 if (currentScore > top10Players[9].Score)
                 {
                     AddNewTopPlayer(new TopPlayerInfo(currentScore, level, gameOver.Name));
                 }
                 game = null;
                 gameOver = null;
                 ranking = new Ranking(top10Players, random);
                 status = GameManagerStatus.Ranking;
                 audio.StopMusic();
             }
             break;
         case GameManagerStatus.Ranking:
             ranking.Update(input.UserCommand);
             if (ranking.ReturnToTitle)
             {
                 ranking = null;
                 title = new Title(random);
                 status = GameManagerStatus.Title;
                 audio.PlayMusic(Music.Title);
             }
             break;
     }
 }
Beispiel #28
0
 public GreenEnemySpawner(Game game, double x, double y)
     : base(game, x, y)
 {
     this.angle = game.Random.Next(0, 360);
     animation = 0;
 }
Beispiel #29
0
 public EndingMessage1(Game game)
     : base(game, -128, Game.FieldHeight / 4, new string[] { "PROGRAM", "", "SINSHU" })
 {
 }
Beispiel #30
0
 public Enemy(Game game, double x, double y)
     : base(game, x, y)
 {
 }