source: 2009/elias_y/WindowsGame1/Game1.cs @ 6741

Revision 70, 3.0 KB checked in by elalylon, 11 years ago (diff)

Aloitin oman pelin tekamisen.

Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using Microsoft.Xna.Framework;
5using Microsoft.Xna.Framework.Audio;
6using Microsoft.Xna.Framework.Content;
7using Microsoft.Xna.Framework.GamerServices;
8using Microsoft.Xna.Framework.Graphics;
9using Microsoft.Xna.Framework.Input;
10using Microsoft.Xna.Framework.Media;
11using Microsoft.Xna.Framework.Net;
12using Microsoft.Xna.Framework.Storage;
13
14namespace WindowsGame1
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}
Note: See TracBrowser for help on using the repository browser.