Hello,
I am new to darkbasicpro also, but I would like to try and help you. I find that I learn DarkBasic best if I make a tutorial for myself. I would like to give you a tutorial on creating a game environment. Something needed for and game.
I dont know the best way to teach it so I will just write it as code.
`*******************************************************************
`ENVIRONMENT TUTORIAL
`*******************************************************************
`HOW TO SET UP THE ENVIRONMENT
`Start a new document and follow the basic instructions to see how
a program environment is created.
`This is a list of what you will learn:
`* Screen refresh rate
`* Game display settings
`* Transparency color
`* Mouse commands
`* Camera controls
`* Basic if loop
`* Set default colors
`* Organize your work
sync on: sync rate 60
`Sets the sync rate to manual, then sets the rate to 60.
hide mouse : disable escapekey
`hides the mouse so we can make our own.
`the disable escape key command, disables the escape key from being
`used to end the program.
`make sure the program can end by itself before you do that.
set image colorkey 0,0,0
`anything black will be transparent
`0 is no color, 255 is max color, of red,green,blue.
autocam off
`this stops the camera from reposistioning.
`itself after each object creation.
`you will be incharge of camera possitions later.
if check display mode(1024,768,32)=1
`method for checking if resolution is good on user computer.
`the =1 sign means the condition is true.
`if you use =0, that means the condition is false.
set display mode 1024,768,32
`sets the display mode.
endif
`ends the if loop above.
`The if loop means, if your computer can do 1024,768,32 resolution.
`the program will set the display mode to that
COLOR_WHITE = RGB(255,255,255)
COLOR_BLACK = RGB(0,0,0)
COLOR_RED = RGB(255,0,0)
COLOR_GREEN = RGB(0,255,0)
COLOR_BLUE = RGB(0,0,255)
`sets the default colors as variables.
`if you use those colors later you dont have to type numbers.
`just the words for the color you want.
`*******************************************************************
`WRITE YOUR PROGRAM
`*******************************************************************
`Without looking at the code you just learned as much as possible, write a program that does the following:
`* Screen refresh rate
Turn on manuel sync and set the sync rate to 20.
`* Game display settings
Set your game display settings for a computer that has
640,480 resolution and can only have 16 bit colors.
`* Transparency color
Your boss what's your program set to black as the
transparency color.
`* Mouse commands
Turn off the mouse so you can make your own.
Disable the escape key but keep it commented so the command
is not active.
`* Camera controls
Turn the camera off to manuel.
`* Basic if loop
Create a basic if loop that will check the computer's video
card then set the display mode. You may need to reorganize
your lines of code you have already typed to make it work.
`* Set default colors
Set the default colors of white, black, red, green, and blue.
Give them only one letter variable names. Starting with the
first letter of the color.
`* Organize your work so it looks clean and presentable
Compile program to see if it runs
I hope this helps. There could be minor errors in my code but it seems all correct to me.
There is something that I cannot figure out also. Please help me if you know someone or you figure it out yourself. I want to make a blinking cursor using two picture files. I thought I could do it by hiding and showing the paisted pictures so it looks like they are blinking. That does not work though and whenever I use the wait command it pauses the whole program.
*I guess I have two problems. How do you use the wait key without it pauseing the whole program?
*How do you create a looping animation using two pictures?
Simple problems sorry I am such a beginner,
Thankyou,
Gilden