コード例 #1
0
 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);
 }
コード例 #2
0
        public void createWind(Raining drop, long gameTime)
        {

            if (gameTime > drop.delay && drop.dustWinds < 10)
            {
                drop._position.X += 10f;
                drop._position.Y += 1f;
                drop.dustWinds++;

            }
        }
コード例 #3
0
        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);
            }

        }
コード例 #4
0
 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);
         }
     }
 }