Hi Lord_Agrikid
gosub is short for "go subroutine". Here is a very simple example of a subroutine:
This_Is_A_Subroutine:
rem do stuff here
return
Notice that the subroutine has a
label (the name you give it), and a
return at the end. This helps organize your code so it doesn't get all messy. So how do you use a subroutine? Like this:
gosub This_Is_A_Subroutine
rem here is our main loop
do
loop
rem -----------------------------------------------
This_Is_A_Subroutine:
rem do stuff
return
So what's new? We have the command
gosub. What that does is it will search for the label
This_Is_A_Subroutine in your program, and jump there. It then begins to execute whatever comes after the label until it runs into the
return command. What that return command does is it sends the program back to where you called the subroutine in the first place, and then continues from there (in our example it then proceeds into the loop we created just underneath).
So why is this stupid
gosub _control_enemies not working you might ask? The compiler is telling you that it cannot find the label
_control_enemies, which means that that subroutine doesn't exist in your program.
The information you provided is not enough to tell you how to fix it. You will have to upload the project folder so we can look at it more in depth. I also advise you to look at some of our great tutorials we have on the forum. Can someone post a link or something, as I have no idea where they are now
TheComet