title: Basic game logic/ai design
body: <p>I'm currently working on my 2D game project (Java), but so far any kind of game logic or AI has been crudely implemented. For instance, say I need to randomly position a bunch of sprites a long the top of the screen, I'd be using the Random class to do this. I'd simply use Random.nextInt( size of x axis on which to spawn ); Although this does work I'd be interested to hear how I should really be going about this kind of thing.</p>
  
  <p>As a second scenario (this is why I put AI in the title, although it's not <em>really</em> AI), say I want to have my characters randomly blink in a life-like fashion. What I'd do here is use the Random class to calculate a % (say 20% chance) of blinking and call it every second. </p>
  
  <p>Any suggestions on how I should really be going about this would be greatly appreciated.</p>