示例#1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            background       = new Background(this, Content);
            fireTexture      = Content.Load <Texture2D>("fire");
            explosionTexture = Content.Load <Texture2D>("Explosion");
            rainTexture      = Content.Load <Texture2D>("rain");
            gameOverFont     = Content.Load <SpriteFont>("GameOver");
            explosionSound   = Content.Load <SoundEffect>("ExplosionSound");
            nextLevelEffect  = Content.Load <SoundEffect>("NextLevel");
            rainParticle     = new RainParticle(this, Content, rainTexture);
            for (int i = 0; i < 15; i++)
            {
                fireParticles.Add(new FireParticles(this, Content, fireTexture, i * 75));
            }
            player.LoadContent(Content);
            enemyModel = new EnemyModel(this, Content);

            for (int i = 0; i < snakeCount; i++)
            {
                enemyList.Add(new Enemy(this, enemyModel, Content, i * 25));
            }
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
        }
示例#2
0
 public EnemyBullet(Game1 game, EnemyModel enemyModel, ContentManager content, Random random, Grid grid)
 {
     this.game    = game;
     this.texture = enemyModel.Texture;
     this.content = content;
     this.random  = random;
     this.grid    = grid;
     LoadContent();
 }
示例#3
0
 public Enemy(Game1 game, EnemyModel model, ContentManager content, int startLocation)
 {
     this.game    = game;
     texture      = model.texture;
     this.content = content;
     bounds.X     = startLocation;
     bounds.Y     = game.GraphicsDevice.Viewport.Height - 75;
     LoadContent();
 }
示例#4
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            player      = new Player(this);
            cityModel   = new CityModel();
            enemyModel  = new EnemyModel();
            mouseCursor = new MouseCursor(this);

            random = new Random();
        }