Click here to Skip to main content
15,879,535 members

Comments by Brian_TheLion (Top 4 by date)

Brian_TheLion 22-Nov-19 0:25am View    
I found what the problem was. The Form1_Load was not being executed. So any code under Form1_Load was not being actioned which means many things did not get loaded at the start of the game.
I've added 'this.load += Form1_Load' under public Form1()

I think the main problem is that with the latest version of Visual Studio some of the defaults like Form1_load has been turned off as in the past the code Form1_load was automatically excited when the program was compiled.
Brian_TheLion 21-Nov-19 17:52pm View    
I am wondering if I should have a picturebox on the form for the stars to be displayed as this was not in the tutorial.
Brian_TheLion 21-Nov-19 17:34pm View    
Thanks for your help.
I tried the if (stars !=null) {..} but it blocks code from happening which results in no stars being shown.
It's strange that it works for the tutor...maybe something to do with different Visual Studio versions as he's using #7. I think I still have #7 of visual studio so I might try it using this version.
Brian_TheLion 20-Nov-19 19:29pm View    
Thanks for your help.
I tried putting 'starts = new PictureBox[10];' under the InitializeComponet(); code
but are now getting a similar error on this line
starts[i].Top += backgroundspeed;
however setting the MoveBhTimer to null solved this problem.
The compiler tells me that stars are null.
I had similar errors for the Munitions part of the code and made the same corrections but now when runing the program nothing happens. I should see stars moving in the sky and be able to move me spacecraft on the screen.

Any more help would be welcomed thanks.