Blitz Basic Tute #1 - Fullscreen

So - would you like me to make some introductory remarks, explain a few concepts and so on or get straight into Doing Something? Hmmm - I thought so! But I must say one thing - I'm assuming that you have Blitz Basic already installed.

  1. For this tutorial you'll need a picture to fill the screen. Save

    into the directory where you intend to do this tutorial.
  2. Create a new text file called fullscreen.bb in the same directory.
  3. Double Click on fullscreen.bb and you're ready to start typing your first BB program.
  4. We need to tell BB (if it's ok with you, I'll use "BB" for "Blitz Basic" most of the time) how big we want the screen to be.
    640 x 480 works fine - we'll use it throughout. So your first BB line will always be: Graphics 640,480
  5. Now we load the picture into the computer and give it a name:
    hill_castle_img=LoadImage("hill_castle.jpg")
  6. The picture is "drawn" to the screen: DrawBlock hill_castle_img,0,0
  7. Click on the red rocket to Run your very first BB program.
  8. Ok, so it's not "fullscreen" as promised but that's easy to fix. But first add two more lines. WaitKey tells BB to wait until we press a key so we can enjoy our handiwork for as long as we want. End will stop that "Program has ended" message. The program will run fullscreen if we disable Debug (I'll tell you all about that later).

I have been programming since the 70's. When Windows arrived, it became very difficult to program even the simplest things. Then Blitz Basic came along! This tute was the very first thing I did and I still remember my excitement at filling the screen with a picture of Alligator Creek Falls. In fact this was the day my adventure game, "Xiama", was born. I hope you've felt the same excitement and sense of achievement.

I'd like to point out a few things before we move on.

Notice the words in yellow. These are the words that BB "knows". The yellow colour is a great help in that it assures you that you haven't made a typing error.

Numbers are in blue.

Strings (as they are called) are in green and are always between quotes.

Words in white are words that you have made up. We didn't have to call it hill_castle_img. abc would have worked just as well, but we will always try to use descriptive names so that when we write a very long program we don't get lost.


Valid HTML 4.0 Strict Valid CSS