Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. Random random = new Random();
  2. for (int i = 0; i < 10; i++)
  3. {
  4. GenPos = new Vector2((800 + (Length * Stone.Width)), (500 - (i * Stone.Height)));
  5.  
  6.  
  7. int number = random.Next(1, 3);
  8.  
  9. if (i == 9)
  10. {
  11. if (Length < 31)
  12. {
  13. i = 0;
  14. Length++;
  15. }
  16.  
  17. }
  18. else if (number == 1)
  19. {
  20. spriteBatch.Draw(Stone, GenPos, Color.White);
  21. }
  22. else if (number > 1)
  23. {
  24. spriteBatch.Draw(Grass, GenPos, Color.White);
  25. }
  26.  
  27. }
  28.  
  29. public Boolean StonePlayerCollision()
  30. {
  31. if (playerPosition.Y >= (StonePosition.Y + Stone.Height) && playerPosition.Y <= StonePosition.Y ))
  32. {
  33. return true;
  34. }
  35. else
  36. {
  37. return false;
  38. }
  39.  
  40. }
  41.  
  42. spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend,
  43. SamplerState.LinearWrap, null, null, null, camera.ViewMatrix);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement