コード例 #1
0
        public virtual bool HitSomething(List <Jet> jets)
        {
            if (IsOwnerPlayerJet())
            {
                for (int i = 0; i < jets.Count; i++)
                {
                    if (HitsJet(jets[i]))
                    {
                        jets[i].GetHit(damage);
                        return(true);
                    }
                }
            }
            else
            {
                PlayerJet jet = GameGlobals.playerJet;

                if (HitsJet(jet))
                {
                    jet.GetHit(damage);
                    return(true);
                }
            }

            return(false);
        }
コード例 #2
0
        public World(Game game, Globals.PassObject resetWorld)
        {
            this.game  = game;
            ResetWorld = resetWorld;

            levelFont          = Globals.content.Load <SpriteFont>("LevelFont");
            levelShowTextTimer = new CustomTimer(3000);
            level = 1;

            playerJet                 = new PlayerJet();
            GameGlobals.playerJet     = playerJet;
            GameGlobals.playerBullets = new List <Bullet2D>();
            destroyedJetCount         = 0;

            bg1 = new ScrollingBackground("star1", new Rectangle(0, 0, 900, 675), 1);
            bg2 = new ScrollingBackground("star2", new Rectangle(0, -675, 900, 675), 1);
            GameGlobals.PassBullet   = AddBullet;
            GameGlobals.PassEnemyJet = AddEnemyJet;
            offset = Vector2.Zero;
            spawners.Add(new CorporalSpawner(new Vector2(200, -200), 20));
            mainMenuSong = Globals.content.Load <Song>("main-music");
            ui           = new UserInterface();
        }
コード例 #3
0
 public Item(string path, Vector2 position, Vector2 dimension)
     : base(path, position, dimension)
 {
     jet   = GameGlobals.playerJet;
     taken = false;
 }