Squids Revenge,
Try this
set display mode 800,600,32
sync on
sync rate 80
do
print "HELP!!!"
sync
cls
loop
. Let me explain.
1.)There is more to
LOOP than just
LOOP. In it's full form it is the
DO LOOP. First, you place the word "DO" above the code you want the computer to loop over and over. This initiates the continuous loop.
2.)You place after that, what you want the computer to do. In this case, it is to print the word "HELP!!!" onto the screen. Study the way that I have setup the
PRINT function.
3.)At the top of my
code snippet I have placed the words
SYNC ON. This turns the screen refresher on. When it is on, it is used in a program to update the screen a number of times a second. In my case, I have coded it's refresh rate to update the screen 80 times a second(EX:
SYNC RATE 80). Without it on, your program, when ran, may not do a thing. There may be displayed, a black screen and the mouse cursor, but it won't move an inch. This is because, without the screen being refreshed a number of times a second, no current information from the computer(variables, print, etc.) is being sent to the screen. The
SYNC command is a
must have.
4.)CLS stands for
clear screen. It does exactly that. Let's say that on the first loop of the
DO LOOP, you have a box drawn on the screen at a certain X(left to right) and Y(top to bottom) coordinate. Then on the second loop, you have coded your program to move the box to the left a number of pixels. Without
CLS, your box will appear smudged to the left. Or ,in other terms, it will look like a rectangle. The
CLS clears the screen of everything drawn to it in the current loop. You will undoubtebly use the
CLS code in all of your 2 dimensional(x coordinate and y coordinate) programs, unless you specifically do not need it, which is rare. You will never use
CLS in a 3 dimensional game or application, unless of course, you are switching at one point, from 3 dimensions to just 2 dimensions, in the same application.
5.)Make sure that you always place SYNC before CLS! Remember, that
SYNC updates the screen and
CLS erases it. If you clear the screen before you update it(post any information onto it), then the screen will not show a thing but blackness, because there is nothing for it to post.
6.)You have placed the code
LOOP into the correct place. But, remember that it is a
DO LOOP, and must include "do" for the start of the loop, and "loop" for the end of the loop.
In closing, the
SET DISPLAY MODE 800,600,32 code is not necessary, but is a standard in the programs I write. In short, your video card(each different video card differs from another) supports certain display types. This piece of code sets the screen width to 800 pixels wide, the screen height to 600 pixels high, and the screen depth(how many colors it can display) to 32 bits. The screen mode cannot be set to just anything. Your video card has limted screen modes.
Well, I hope this will be useful to you. Enjoy. If you have any tough questions that you have already tried over and over to answer them yourself, but you just can't figure it out. You can email me at
[email protected] with them. I will try to help you get on your feet in the world of programming. But, do take time to experiment with the problem
first. In doing this, you will learn the syntax(rules) of the DarkBasic language faster, and retain them in memory longer. Remember, be patient, and know that you will only learn through applying what you've learned, to teach yourself more.
+NanoBrain+