]> Dogcows Code - chaz/carfire/blob - CarFire/CarFire/CarFire/Game1.cs
Adding blank VS2008 solution to start from.
[chaz/carfire] / CarFire / CarFire / CarFire / Game1.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using Microsoft.Xna.Framework;
5 using Microsoft.Xna.Framework.Audio;
6 using Microsoft.Xna.Framework.Content;
7 using Microsoft.Xna.Framework.GamerServices;
8 using Microsoft.Xna.Framework.Graphics;
9 using Microsoft.Xna.Framework.Input;
10 using Microsoft.Xna.Framework.Media;
11 using Microsoft.Xna.Framework.Net;
12 using Microsoft.Xna.Framework.Storage;
13
14 namespace CarFire
15 {
16 /// <summary>
17 /// This is the main type for your game
18 /// </summary>
19 public class Game1 : Microsoft.Xna.Framework.Game
20 {
21 GraphicsDeviceManager graphics;
22 SpriteBatch spriteBatch;
23
24 public Game1()
25 {
26 graphics = new GraphicsDeviceManager(this);
27 Content.RootDirectory = "Content";
28 }
29
30 /// <summary>
31 /// Allows the game to perform any initialization it needs to before starting to run.
32 /// This is where it can query for any required services and load any non-graphic
33 /// related content. Calling base.Initialize will enumerate through any components
34 /// and initialize them as well.
35 /// </summary>
36 protected override void Initialize()
37 {
38 // TODO: Add your initialization logic here
39
40 base.Initialize();
41 }
42
43 /// <summary>
44 /// LoadContent will be called once per game and is the place to load
45 /// all of your content.
46 /// </summary>
47 protected override void LoadContent()
48 {
49 // Create a new SpriteBatch, which can be used to draw textures.
50 spriteBatch = new SpriteBatch(GraphicsDevice);
51
52 // TODO: use this.Content to load your game content here
53 }
54
55 /// <summary>
56 /// UnloadContent will be called once per game and is the place to unload
57 /// all content.
58 /// </summary>
59 protected override void UnloadContent()
60 {
61 // TODO: Unload any non ContentManager content here
62 }
63
64 /// <summary>
65 /// Allows the game to run logic such as updating the world,
66 /// checking for collisions, gathering input, and playing audio.
67 /// </summary>
68 /// <param name="gameTime">Provides a snapshot of timing values.</param>
69 protected override void Update(GameTime gameTime)
70 {
71 // Allows the game to exit
72 if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
73 this.Exit();
74
75 // TODO: Add your update logic here
76
77 base.Update(gameTime);
78 }
79
80 /// <summary>
81 /// This is called when the game should draw itself.
82 /// </summary>
83 /// <param name="gameTime">Provides a snapshot of timing values.</param>
84 protected override void Draw(GameTime gameTime)
85 {
86 GraphicsDevice.Clear(Color.CornflowerBlue);
87
88 // TODO: Add your drawing code here
89
90 base.Draw(gameTime);
91 }
92 }
93 }
This page took 0.0351 seconds and 4 git commands to generate.