Tech Off Post

Single Post Permalink

View Thread: Discuss the Beginning Game Development series on Coding 4 Fun
  • User profile image
    A Programmer

    I downloaded, built and ran the C# code included with the latest (session 6) edition of the article. The results were not quite what I had expected:

    System.NullReferenceException was unhandled
      Message="Object reference not set to an instance of an object."
      Source="BattleTank2005"
      StackTrace:
           at BattleTank2005.GameEngine.Render() in E:\Documents and Settings\Michael\My Documents\MSDN\BattleTank 2005 Part VI - CS\BattleTank2005\GameEngine.cs:line 72
           at BattleTank2005.GameEngine.OnPaint(PaintEventArgs e) in E:\Documents and Settings\Michael\My Documents\MSDN\BattleTank 2005 Part VI - CS\BattleTank2005\GameEngine.cs:line 64
           at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
           at System.Windows.Forms.Control.WmPaint(Message& m)
           at System.Windows.Forms.Control.WndProc(Message& m)
           at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
           at System.Windows.Forms.ContainerControl.WndProc(Message& m)
           at System.Windows.Forms.Form.WndProc(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
           at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
           at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
           at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.Run(Form mainForm)
           at BattleTank2005.Program.Main() in E:\Documents and Settings\Michael\My Documents\MSDN\BattleTank 2005 Part VI - CS\BattleTank2005\Program.cs:line 22
           at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()