On monday’s afternoon waiting a C++ lesson, I surf on the web. But there aren’t a lot of news, so in a fully bother I go on a flash game’s website and I play a game with Starship, asteroid… I’m sure you know that kind of game 😉 And I ask myself about it mechanism.
After some research I discover the term “Starfield” but no explanation nowhere about how it works, therefore I decide to programme one !
So in fact a Starfield is a perpetual movement of Stars in a restrected field. I know this a little short 😀
The idea is to have a movement in your field and only there, so if a Star go away it should be deleted or puted back. And in fact that the field itself which is moving on the stage.
There is all the code below, but look at the application before !
Click on the animation and use arrow’s keyboard for moving the Starship. In this example the Starship never moves, it’s the Starfield !!