This tutorial will show you the minimum you need to get a basic, error free window working in PlayBasic.
PlayBasic Minimum Tutorial
The code needed to get a simple, error free window working in PlayBasic is so simple it only requires four lines. So, let's just jump right into the code :
Print "Barkin' Mad PlayBasic"
Sync
WaitKey
End
Each line of code in this example is known as a function. Here's what each line does :
Print displays a line of text to the screen. The line of text to be displayed is written in double quotes right next to it. If you wanted to display the text "My PlayBasic Game" you would use this code :
Print "My PlayBasic Game"
Print is the most basic way of displaying text in PlayBasic and you won't be using it much. It is used in this tutorial for simplicity.
Sync
Anything displayed with Print will not be seen until you use Sync. This is because PlayBasic doesn't draw the screen every time you use Print or any other display function. Instead, it draws it all at once when Sync is used.
WaitKey
WaitKey pauses the game and waits until the player presses a key. This is useful if you want to give the player time to read what you have just displayed, as in this case.
End
PlayBasic will naturally end the game when it runs out of code to run. If you want to command it to end the game, you can use End. Thought it isn't needed in an example like this, it's considered good programming practice to include it so that you and people reading your code know that the game is supposed to end there.
Conclusion
See, wasn't that easy?
Dedication
Some of you may find the phrase "Barkin' Mad PlayBasic" to be familiar. This was the name of a tutorial series the original administrator of GDN (then GDHQ) was working on when he died. This tutorial is dedicated to him. Love you man, but not in a gay way. :)