James 的个人资料BluePhaze照片日志列表更多 工具 帮助

日志


11月5日

XNA QnA - Default Starting Methods

Ok so questions I have gotten quite a few times from those starting fresh with XNA Studio Express relate to what are the built in Methods in my code for when I start my project. This is a great question as XNA studio automatically plugs in some code for you when you create a new game project. These are there to take out some of the initial guess work and are the main building blocks any graphics oriented game application are going to need. To answer I always like to stick as close to the help materials as possible. In this case the XNA Studio Express help documentation handles this more than adequately. Here is the section explaining the built in code blocks:
 

Some of the hard work has already been done for you. If you build and run your game now, the GraphicsDeviceManager will handle setting up your screen size and rendering a blank screen. Your game will run and update all by itself. It's up to you to insert your own code to make the game more interesting.

Much of the code to start and run your game has already been written for you, and all have places for you to insert your code:

  • The Initialize method is where you can initialize any assets that do not require a GraphicsDevice to be initialized.
  • The LoadGraphicsContent method is where you load any graphical assets such as models and textures.
  • The UnloadGraphicsContent method is where any graphical assets can be released. Normally, no extra code is required here, as assets will be released automatically when they are no longer needed.
  • The Update loop is the best place to update your game logic: move objects around, take player input, decide the outcome of collisions between objects, and so on.
  • The Draw loop is the best place to render all of your objects and backgrounds on the screen.

 

As this is a technology that has great interest for me I will continue to post answers to questions I commonly get in my blog here.

                                         

                                                                               

评论

请稍候...
很抱歉,您输入的评论太长。请缩短您的评论。
您没有输入任何内容,请重试。
很抱歉,我们当前无法添加您的评论。请稍后重试。
若要添加评论,需要您的家长授予您相应权限。请求权限
您的家长禁用了评论功能。
很抱歉,我们当前无法删除您的评论。请稍后重试。
您已超过了一天之内允许提供的评论数上限。请在 24 小时后重试。
因为我们的系统表明您可能在向其他用户提供垃圾评论,您的帐户已禁用了评论功能。如果您认为我们错误地禁用了您的帐户,请联系 Windows Live 支持部门
完成下面的安全检查,您提供评论的过程才能完成。
您在安全检查中键入的字符必须与图片或音频中的字符一致。

若要添加评论,请使用您的 Windows Live ID 登录(如果您使用过 Hotmail、Messenger 或 Xbox LIVE,您就拥有 Windows Live ID)。登录


还没有 Windows Live ID 吗?请注册

引用通告

此日志的引用通告 URL 是:
http://bluephaze.spaces.live.com/blog/cns!364D4F01994932D3!299.trak
引用此项的网络日志