1. if (tempEnemy.x < 0)
  2. {
  3. tempEnemy.rotation = -45;
  4. }
  5. if (tempEnemy.x > stage.stageWidth)
  6. {
  7. tempEnemy.rotation = 45;
  8. }