Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 02 Mar 2012
Offline Last Active Jun 18 2013 08:05 PM

Posts I've Made

In Topic: seeding randomly but can still do the same every time

02 March 2013 - 03:38 AM

You want random positions on a tile-based map, but you don't want the positions to be locked to the tiles, right?  The best way to do that is to generate numbers on a larger scale than your grid-based map is on.  For example, if your map is a 20x20 grid, generate random numbers from, say, 0-400 for the coordinates, then divide them by 20.  This will get you random decimal coordinates between 0-20.


And if you want the same results every time you run the program, you do not want to call srand, or you want to call it with constant number as a parameter.