title: Create a game loop in Java for a 2D space shooter game
body: <p>I'm having some trouble figuring out the best way to implement a game loop in my game. I'm trying to a make a gradius clone and I've run into some performance issues using swing. I'm thinking about using threads but I have not used them before. </p>
  
  <p>The particular problem I am running into is how to get a delta time passed into my enemy sub class' update method. I need that delta time so that I can get my enemies moving on sine waves. Anyone know the best way to get a dt from a thread and using it to make my enemies move on sin/cos waves?</p>