New to programming and need some help getting started ? - Well, then our tutorial section will help kick start your programming adventure.
If you're looking for more Source Code / Tutorials & Media ? - Then remember to visit the PlayBasic Resource board on our forums.
Found #2 items in Functions category by Kevin Picone
Hi welcome to our Intro to PlayBasic Functions tutorial. In this tutorial we start out with some revision of Gosub / Return statements, which are used to create a simple sub routine. Sub routines are changes in program flow, allowing the programmer to execute a chunk of code that's external to the section they may be writing, then upon completion the control returns to the caller. This is the same basic model that functions introduction to our programming, except functions are more formalized. Meaning they have some strict rules about syntax and intro a new concepts such as scope changes, which sub routines don't have.
The types of functions shown in video are very simple, initially we start by taking a sub routine that prints rows of text and convert that to function. Through this process we encounter our first problem which is variable scope and look at ways to solve it, such as making our variable global, or better yet passing a variable into the function as a parameter . Later in the video, we create our own custom distance function, as well building a function that does some simple string manipulation
NOTE: This video was recorded alive with only a few changes for length..
Learn basic game programming in this 10 part tutorial series for beginners. This series covers everything from Variables, Arrays, Program Structure, Loops, Functions through to various articles on game timing and logic.