Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Audio;
- using Microsoft.Xna.Framework.Content;
- using Microsoft.Xna.Framework.Graphics;
- using Microsoft.Xna.Framework.Input;
- using Microsoft.Xna.Framework.Media;
- public class Entry {
- static public int Main () {
- using (GameProper game = new GameProper()) {
- game.Run();
- }
- return 0;
- }
- }
- public class GameProper : Microsoft.Xna.Framework.Game {
- SpriteBatch spriteBatch;
- GraphicsDeviceManager graphics;
- private Texture2D background;
- private Texture2D shuttle;
- private Texture2D earth;
- public GameProper() {
- graphics = new GraphicsDeviceManager(this);
- Content.RootDirectory = "content";
- }
- protected override void LoadContent() {
- // Create a new SpriteBatch, which can be used to draw textures.
- spriteBatch = new SpriteBatch(GraphicsDevice);
- // This is the code we added earlier.
- background = Content.Load<Texture2D>("stars"); // change these names to the names of your images
- shuttle = Content.Load<Texture2D>("shuttle"); // if you are using your own images.
- earth = Content.Load<Texture2D>("earth");
- }
- protected override void Draw(GameTime gameTime) {
- graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
- spriteBatch.Begin();
- spriteBatch.Draw(background, new Rectangle(0, 0, 800, 480), Color.White);
- spriteBatch.Draw(earth, new Vector2(400, 240), Color.White);
- spriteBatch.Draw(shuttle, new Vector2(450, 240), Color.White);
- spriteBatch.End();
- base.Draw(gameTime);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement