Tutorial #1.1 - The Beginning
The DIV language isn't the easiest to learn and I am not an expert by any stretch of the imagination. What I say during the tutorials shouldn't be taken as hardcore fact. Anyway, the beginning seems to be the easiest place to start so lets get going...
PROGRAM starwars;
BEGIN
END
Every program that you make with DIV will have these commands. Put simply these are three commands you won't be able to forget!
PROGRAM starwars;
The PROGRAM statement is telling DIV that this is a new game. The word(s) that come after this command is the internal name for the program, which in this case is starwars. Most commands then need a kind of a full stop/period. This comes in the shape of a ';'
BEGIN
This tells DIV to start the game code. Before this command we can declare variables, constants and much more, but it's a little too complicated to go into right now!
END
The end command (funnily enough) tells DIV to stop whatever it was told to do. We can use the END command to end anything that we begin - in fact, without an END command could get into a lot of difficulty!
Okay, not too much to go wrong there! So create a new program (programs / new) and type in the filename 'starwars.prg' - yeah, we'll make a simple game (Crikey! What have I got myself into here?). So, type out the program below to start us off:
PROGRAM starwars;
BEGIN
load_fpg("starwars.fpg");
END
Please don't try to run this program until we've created
a new FPG file, or else you'll end up with a plethora of errors
(well, at least one)! We will create the FPG file in tutorial
number 2, which sould be out soon, until then, happy DIVing:)
This tutorial is ©2000 Fore-go gaming.