private void addOne() { int xStart = (int)(player._position.X - graphics.Viewport.Width / 2); int xEnd = xStart + graphics.Viewport.Width; int yStart = (int)(player._position.Y - graphics.Viewport.Height); int yEnd = yStart + graphics.Viewport.Height / 2; Raining rain = new Raining(new Vector2(randInt(xStart - graphics.Viewport.Width / 4, xEnd + graphics.Viewport.Width / 4), randInt(yStart, yEnd))); rain.LoadContent(Content, graphics); rainList.Add(rain); }
public void createWind(Raining drop, long gameTime) { if (gameTime > drop.delay && drop.dustWinds < 10) { drop._position.X += 10f; drop._position.Y += 1f; drop.dustWinds++; } }
public void Load(ContentManager Content, GraphicsDevice graphics) { this.graphics = graphics; Raining.Load(Content); setDropAmount(); this.Content = Content; loadList(); for (int i = 0; i < rainList.Count; i++) { rainList[i].LoadContent(Content, graphics); } }
private void loadList() { int xStart = (int)(player._position.X - graphics.Viewport.Width / 2); int xEnd = xStart + graphics.Viewport.Width; int yStart = (int)(player._position.Y - graphics.Viewport.Height / 2) + (graphics.Viewport.Height - 700); int yEnd = yStart + graphics.Viewport.Height; if (rainList.Count < dropAmount) { int size = rainList.Count; for (int i = 0; i < dropAmount - size; i++) { Raining rain = new Raining(new Vector2(randInt(xStart, xEnd), randInt(yStart, yEnd))); rain.LoadContent(Content, graphics); rainList.Add(rain); } } }