You are only moving the stars that reach the edge, maybe group them together? or create a function to move them all? Also, if you want to do wrapping in a simple way, create a layer with no scrolling and whenever the player moves and depending on how fast the player is moving, move the stars. If they have wrapping behaviour they should automatically appear on the other side and you can do this on multiple layers and move the stars different amounts for each layer, creating a star field illusion.