Note that the star-spawning I used above is 'pure random' which can give less-than-pleasing results - I was in a hurry.
But it's a start in the right direction and can be improved upon later.
Ok so just done a little more messing around with it and got it to draw, however, when my ship moves, the stars arent re drawing
Show me your code.
If it's a single file of code, post it to PasteBin.com and post the link here.
If it's multiple files worth of code, zip it up into a zip file, and upload it to DropBox, OneDrive, GoogleDrive, or any other direct-linkable file hosting service.
(Preferably one that isn't full of ads, and definitely one that doesn't require me to sign up just to download the file)
In videogames, you need to redraw the entire screen, and everything on the screen, every single frame (every single loop of the main loop).
The order is:
- Clear the screen: window.clear()
- Draw the objects in the order you want them to appear: window.draw(...whatever...)
- Apply the changes, so it shows up on the user's monitor: window.display()
See SFML's short example.
You never just draw an image once - you draw it over and over and over and over again, one draw for each frame. You should only call "clear()" and only call "display()" once per frame.