/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); _snowEmitter = new SnowEmitter(new Sprites.Sprite(Content.Load <Texture2D>("Particles/Snow"))); }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); Resources.LoadImages(Content); Resources.LoadFonts(Content); Resources.LoadSounds(Content); menu = new Menu(this, GraphicsDevice, level); music = Content.Load <Song>("sounds\\Grassland"); MediaPlayer.IsRepeating = true; // MediaPlayer.Play(music); level.CreateWorld(level.Level1); _scrollingBackgrounds = new List <ScrollingBackground>() { new ScrollingBackground(Resources.Images["Hills1"], player, 60f) { Layer = 0.99f, }, new ScrollingBackground(Resources.Images["Mountain1"], player, 60f) { Layer = 0.9f, }, new ScrollingBackground(Resources.Images["Hills2"], player, 40f) { Layer = 0.8f, }, new ScrollingBackground(Resources.Images["Cloud1"], player, 25f, true) { Layer = 0.97f, }, new ScrollingBackground(Resources.Images["Mountain2"], player, 30f) { Layer = 0.89f, }, new ScrollingBackground(Resources.Images["Mountain3"], player, 20f) { Layer = 0.88f, }, new ScrollingBackground(Resources.Images["Cloud2"], player, 10f, true) { Layer = 0.70f, }, new ScrollingBackground(Resources.Images["Mountain4"], player, 45f) { Layer = 0.87f, }, new ScrollingBackground(Resources.Images["Sky"], player, 0f) { Layer = 0.1f, }, }; _snowEmitter = new SnowEmitter(new Snow.Snow(Resources.Images["Snow"])); }
private Vector3 previousSighting; // Where the player was sighted last frame. #endregion Fields #region Methods void Awake() { // Setting up the references. nav = GetComponent<NavMeshAgent>(); col = GetComponent<SphereCollider>(); anim = GetComponent<Animator>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>(); player = GameObject.FindGameObjectWithTag(DoneTags.player); playerAnim = player.GetComponent<Animator>(); playerHealth = player.GetComponent<DonePlayerHealth>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>(); GameObject go = GameObject.FindGameObjectWithTag("SnowEmitter"); snowEmitter = go.GetComponent<SnowEmitter>(); // Set the personal sighting and the previous sighting to the reset position. personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }
public override void LoadContent() { this.spriteBatch = new SpriteBatch(GraphicManagers.GraphicsDevice); this.snowEmitter = new SnowEmitter(new SpriteLike(TextureFactory.Content.Load <Texture2D>("Particles/Snow"))); }