To make the pseudo 3-D effect of the trophy and ship spinning around each other on the final screen of Space Racer I just used a simple scaling trick. By gradually changing the scale in SpriteBatch it appears as if the sprites are zooming in and out along the Z-axis.
To do this, let's first make a new Windows Game project in C#. Call it SpinningSprites. Click OK, build and run the empty game to be presented with the familiar cornflower blue screen.
Now that we know everything was created as planned we need to add content to our project.
To do this, let's first make a new Windows Game project in C#. Call it SpinningSprites. Click OK, build and run the empty game to be presented with the familiar cornflower blue screen.
Now that we know everything was created as planned we need to add content to our project.
Go ahead and copy these images to your hard drive by right clicking and saving. Or if you'd like, you can use your own images. Add them to the game by dragging the images to the SpinningSpritesContent project in Visual Studio or right click on the SpinningSpritesContent project and choose Add->Existing Item. Find and select the images and click Add.
Now that we've added the content it's time to add some code. Towards the top of the class, add two Texture2D variables just after the GraphicsDeviceManager and SpriteBatch declarations.
Now that we've added the content it's time to add some code. Towards the top of the class, add two Texture2D variables just after the GraphicsDeviceManager and SpriteBatch declarations.
Texture2D imageOne;
Texture2D imageTwo;
Texture2D imageTwo;