Quote: "1. When is it better to use a function over a subroutine or vice versa? "
If you need a value returned to you based on parameters then I'd say functions are better to use. An example would be a function to get the distance between two sprites. You could have something like:
distance# = Get_Distance (x1,y1,x2,y2)
This wouldn't be too pretty as a subroutine. Try it if you like, create a couple of sprites and get the distances between each of the sprites. I think you'll find the function to be a lot easier.
I, like Bursar, use only functions because they are neater in a sense but are also supported by C++ unlike subroutines used in this sense.
I have also heard users say that functions are called (or executed) faster than subroutines. I can't confirm this however so if someone else would like to?
A good practice is to optimize your code as much as you can i.e make it perform as efficiently as possible. Since joining the App Developers Group I've learnt the importance of optimizing code. It is most likely that your development machine will run any program you write in AppGameKit quite smoothly but what about when you port it to devices like netbooks, iphones etc which are far less powerful?
Let's say you are positioning a sprite based on it's width each loop and it doesn't change size e.g SetSpritePosition( sprite, x + GetSpriteWidth(sprite), y ).
Each loop the GetSpriteWidth() function is called and it has to go through every process necessary to return the sprite's width. What you could do is store the width in a variable before the loop begins and so instead of the program calling the GetSpriteWidth function each loop it calls upon the value of the variable instead (which we can safely say is a lot faster than calling a function). So you would have something like this:
SetSpritePosition(sprite, x + sprite_width, y)
NOTE: this specific example will only work with sprites that don't change size.
That's all I've got for now, happy coding.