Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System
- Imports System.Collections.Generic
- Imports System.Linq
- Imports Microsoft.Xna.Framework
- Imports Microsoft.Xna.Framework.Audio
- Imports Microsoft.Xna.Framework.Content
- Imports Microsoft.Xna.Framework.GamerServices
- Imports Microsoft.Xna.Framework.Graphics
- Imports Microsoft.Xna.Framework.Input
- Imports Microsoft.Xna.Framework.Media
- Imports Microsoft.Xna.Framework.Net
- Imports Microsoft.Xna.Framework.Storage
- ''' <summary>
- ''' This is the main type for your game
- ''' </summary>
- Public Class CBaseClient ' You could also call this class "Game1" I suppose
- Inherits Microsoft.Xna.Framework.Game
- Dim graphics As GraphicsDeviceManager
- Dim spriteBatch As SpriteBatch
- Public Sub New()
- graphics = New GraphicsDeviceManager(Me)
- Content.RootDirectory = "Content"
- End Sub
- ''' <summary>
- ''' Allows the game to perform any initialization it needs to before starting to run.
- ''' This is where it can query for any required services and load any non-graphic
- ''' related content. Calling base.Initialize will enumerate through any components
- ''' and initialize them as well.
- ''' </summary>
- Protected Overrides Sub Initialize()
- ' TODO: Add your initialization logic here
- MyBase.Initialize()
- End Sub
- ''' <summary>
- ''' LoadContent will be called once per game and is the place to load
- ''' all of your content.
- ''' </summary>
- Protected Overrides Sub LoadContent()
- MyBase.LoadContent()
- ' Create a new SpriteBatch, which can be used to draw textures.
- spriteBatch = New SpriteBatch(GraphicsDevice)
- ' TODO: use this.Content to load your game content here
- End Sub
- ''' <summary>
- ''' UnloadContent will be called once per game and is the place to unload
- ''' all content.
- ''' </summary>
- Protected Overrides Sub UnloadContent()
- MyBase.UnloadContent()
- ' TODO: Unload any non ContentManager content here
- End Sub
- ''' <summary>
- ''' Allows the game to run logic such as updating the world,
- ''' checking for collisions, gathering input, and playing audio.
- ''' </summary>
- ''' <param name="gameTime">Game time snapshot</param>
- Protected Overrides Sub Update(ByVal gameTime As GameTime)
- ' Allows the game to exit
- If Keyboard.GetState().IsKeyDown(Keys.Escape) Then Me.Exit()
- ' TODO: Add your update logic here
- MyBase.Update(gameTime)
- End Sub
- ''' <summary>
- ''' This is called when the game should draw itself.
- ''' </summary>
- ''' <param name="gameTime">Game time snapshot</param>
- Protected Overrides Sub Draw(ByVal gameTime As Microsoft.Xna.Framework.GameTime)
- GraphicsDevice.Clear(Color.CornflowerBlue)
- spriteBatch.Begin(SpriteBlendMode.AlphaBlend)
- ' TODO: Add your drawing code here
- spriteBatch.End()
- MyBase.Draw(gameTime)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement