Guest User

Untitled

a guest
Oct 17th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public Ship(Texture2D shipsheet, Rectangle hitbox, Rectangle sourceRectangle, bool rotated)
  2.  
  3. ships = new Ship[5];
  4. Rectangle shipHitbox;
  5.  
  6.  
  7. for (int i = 0; i < ships.GetLength(0); i++)
  8. {
  9. int x = Rand(0, 9) * 60;
  10. int y = Rand(0, 9) * 60;
  11.  
  12. shipHitbox = new Rectangle(x, y, 60 + (60 * i), 60);
  13. shipSourceRectangle = new Rectangle(0, (60 * i), 60 + (60 * i), 60);
  14. rotated = random.Next(2) == 0 ? false : true;
  15.  
  16.  
  17. ships[i] = new Ship(shipsheet, shipHitbox, shipSourceRectangle, rotated);
  18. }
Add Comment
Please, Sign In to add comment