Example #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);
 }
Example #2
0
 public SnakeBody(Game game, double x, double y, bool tail)
     : base(game, x, y)
 {
     this.tail = tail;
     angle = 0;
     isDead = false;
 }
Example #3
0
File: Snake.cs Project: sinshu/dtf
 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;
 }
Example #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;
 }
Example #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;
 }
Example #6
0
File: Player.cs Project: sinshu/dtf
 public Player(Game game, double x, double y)
     : base(game, x, y)
 {
     vx = vy = 0;
     fireCount = 0;
     isDead = false;
     freeze = false;
     warpSpeed = 8;
 }
Example #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);
 }
Example #8
0
File: Borg.cs Project: sinshu/dtf
 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;
 }
Example #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);
 }
Example #10
0
File: Mushi.cs Project: sinshu/dtf
 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;
 }
Example #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;
 }
Example #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;
 }
Example #13
0
File: Teki.cs Project: sinshu/dtf
 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;
 }
Example #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;
 }
Example #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;
 }
Example #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;
 }
Example #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;
        }
Example #18
0
 public PlayerBullet(Game game, double x, double y, double speed, int angle)
     : base(game, x, y, speed, angle)
 {
     isDead = false;
 }
Example #19
0
 public EndingMessage3(Game game)
     : base(game, -128, Game.FieldHeight / 4, new string[] { "SOUND EFFECTS", "", "HA810" })
 {
 }
Example #20
0
File: Bullet.cs Project: sinshu/dtf
 public Bullet(Game game, double x, double y, double speed, int angle)
     : base(game, x, y)
 {
     this.speed = speed;
     this.angle = angle;
 }
Example #21
0
File: Smoke.cs Project: sinshu/dtf
 public Smoke(Game game, double x, double y, int angle)
     : base(game, x, y)
 {
     this.angle = angle;
     animation = 0;
 }
Example #22
0
File: Funnel.cs Project: sinshu/dtf
 public Funnel(Game game, double x, double y)
     : base(game, x, y)
 {
 }
Example #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);
 }
Example #24
0
 public GameObject(Game game, double x, double y)
 {
     this.game = game;
     this.x = x;
     this.y = y;
 }
Example #25
0
File: Effect.cs Project: sinshu/dtf
 public Effect(Game game, double x, double y)
     : base(game, x, y)
 {
 }
Example #26
0
 public EndingMessage6(Game game)
     : base(game, Game.FieldWidth + 128, Game.FieldHeight / 4, new string[] { "", "THANK YOU FOR PLAYING", ""})
 {
 }
Example #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;
     }
 }
Example #28
0
 public GreenEnemySpawner(Game game, double x, double y)
     : base(game, x, y)
 {
     this.angle = game.Random.Next(0, 360);
     animation = 0;
 }
Example #29
0
 public EndingMessage1(Game game)
     : base(game, -128, Game.FieldHeight / 4, new string[] { "PROGRAM", "", "SINSHU" })
 {
 }
Example #30
0
File: Enemy.cs Project: sinshu/dtf
 public Enemy(Game game, double x, double y)
     : base(game, x, y)
 {
 }