GraphicsDeviceManager graphics;\r
SpriteBatch spriteBatch;\r
\r
- Texture2D background;\r
- Texture2D spotLight;\r
- Texture2D cs;\r
+ lobbyGUI lbGui;\r
\r
- Vector2 backgroundPos;\r
- Vector2 spotLightPos;\r
- Vector2 spotLightCenter;\r
- Vector2 csPos;\r
-\r
- Vector2 zero;\r
- Vector2 spotLightVelocity;\r
-\r
- int MaxX;\r
- int MinX;\r
- int MaxY;\r
- int MinY;\r
+ NetworkSession networkSession;\r
+ AvailableNetworkSessionCollection availableSessions;\r
+ int selectedSessionIndex;\r
\r
public Game1()\r
{\r
graphics = new GraphicsDeviceManager(this);\r
Content.RootDirectory = "Content";\r
+ Components.Add(new GamerServicesComponent(this));\r
}\r
\r
/// <summary>\r
// TODO: Add your initialization logic here\r
graphics.PreferredBackBufferWidth = 800;\r
graphics.PreferredBackBufferWidth = 600;\r
+ lbGui = new lobbyGUI();\r
base.Initialize();\r
}\r
\r
{\r
// Create a new SpriteBatch, which can be used to draw textures.\r
spriteBatch = new SpriteBatch(GraphicsDevice);\r
- background = Content.Load<Texture2D>("background");\r
- spotLight = Content.Load<Texture2D>("spotlight");\r
- cs = Content.Load<Texture2D>("cs");\r
- backgroundPos = new Vector2(0f, 0f);\r
- spotLightPos = new Vector2(100f, graphics.GraphicsDevice.Viewport.Height - 98);\r
- spotLightCenter = new Vector2(800f, 800f);\r
- spotLightVelocity = new Vector2(-100, 33);\r
- csPos = new Vector2(10f, graphics.GraphicsDevice.Viewport.Height - 98);\r
- \r
- zero = new Vector2(0, 0);\r
-\r
- MaxX = graphics.GraphicsDevice.Viewport.Width;\r
- MinX = 0;\r
- MaxY = graphics.GraphicsDevice.Viewport.Height;\r
- MinY = 100;\r
- // TODO: use this.Content to load your game content here\r
+ lbGui.LoadContent(Content, graphics);\r
+ \r
}\r
\r
/// <summary>\r
this.Exit();\r
\r
// TODO: Add your update logic here\r
- UpdateSpotLight(gameTime);\r
+ lbGui.Update(gameTime);\r
+ \r
base.Update(gameTime);\r
}\r
\r
{\r
GraphicsDevice.Clear(Color.CornflowerBlue);\r
spriteBatch.Begin(SpriteBlendMode.AlphaBlend);\r
- // TODO: Add your drawing code here\r
- spriteBatch.Draw(background, backgroundPos, null, Color.White, 0, zero, 0.5f, SpriteEffects.None, 0);\r
- spriteBatch.Draw(cs, csPos, null, Color.White, 0, zero, 0.5f, SpriteEffects.None, 0);\r
- spriteBatch.Draw(spotLight, spotLightPos, null, Color.White, 0, spotLightCenter, 1f, SpriteEffects.None, 0);\r
\r
+ lbGui.Draw(spriteBatch);\r
+ \r
spriteBatch.End();\r
base.Draw(gameTime);\r
}\r
-\r
- private void UpdateSpotLight(GameTime gameTime)\r
- {\r
- spotLightPos = new Vector2(spotLightPos.X + spotLightVelocity.X * (float)gameTime.ElapsedGameTime.TotalSeconds,\r
- spotLightPos.Y + spotLightVelocity.Y * (float)gameTime.ElapsedGameTime.TotalSeconds);\r
-\r
- if (spotLightPos.X > MaxX || spotLightPos.X < MinX) //right or left wall\r
- {\r
- spotLightVelocity = new Vector2(spotLightVelocity.X * -1, spotLightVelocity.Y);\r
- }\r
- else if (spotLightPos.Y > MaxY || spotLightPos.Y < MinY) //top or bottom wall\r
- {\r
- spotLightVelocity = new Vector2(spotLightVelocity.X, spotLightVelocity.Y * -1);\r
- }\r
- }\r
+ \r
}\r
}\r