I thought that I would post this incase anybody was interested in learning darkbasic.
This is a simple program. When you are finished, if you did everything correcly, you will be able to turn a cube in all directions using the arrow keys. Type the code in EXACTLY as I have it here. Here we go......
This code tells the computer to turn sync on. When you choose the sync rate, you are tell the computer how many times you want it to refresh every second.
This code makes the cube that you will be spinning. The first number(1), is the ID of the cube. You will need that to refer to it later. The second number is the size of the cube. 100 is a good size for this program, but you can change it if you want.
You always type Do once you are ready to start giving the computer the interactive commands. Meaning, the commands that will be used for the arrow keys and things like that.
These are they up and down, left and right arrow key commands. All I really need to explain are the numbers at the end. The firsy number is the one of the object that you want moved. Remember the ID we gave the cube? Well this is where it would be used. The second number is the number of worlds it goes when you press the key. Pretty much, the higher the number, the faster it is.
This has to be at the end of an interactive program.
This is telling the program to loop the program whenever something happens. Otherwise, you would only be able to press the arrow key once and that would be the end of the program.
If this code isn't here, the program will come up and go away so fast that you won't be able to do it. This command is telling the program to wait until the right key is pressed it stop.
Well, I hope this was helpful. If there are any problems, please let me know.
This is a simple program. When you are finished, if you did everything correcly, you will be able to turn a cube in all directions using the arrow keys. Type the code in EXACTLY as I have it here. Here we go......
- Code:
Sync on
Sync Rate 30
This code tells the computer to turn sync on. When you choose the sync rate, you are tell the computer how many times you want it to refresh every second.
- Code:
make object cube 1,100
This code makes the cube that you will be spinning. The first number(1), is the ID of the cube. You will need that to refer to it later. The second number is the size of the cube. 100 is a good size for this program, but you can change it if you want.
- Code:
Do
You always type Do once you are ready to start giving the computer the interactive commands. Meaning, the commands that will be used for the arrow keys and things like that.
- Code:
if upkey()=1 then pitch object down 1,3
if downkey()=1 then pitch object up 1,3
If leftkey()=1 then Turn Object right 1,3
If Rightkey()=1 then Turn Object left 1,3
These are they up and down, left and right arrow key commands. All I really need to explain are the numbers at the end. The firsy number is the one of the object that you want moved. Remember the ID we gave the cube? Well this is where it would be used. The second number is the number of worlds it goes when you press the key. Pretty much, the higher the number, the faster it is.
- Code:
Sync
This has to be at the end of an interactive program.
- Code:
loop
This is telling the program to loop the program whenever something happens. Otherwise, you would only be able to press the arrow key once and that would be the end of the program.
- Code:
wait key
If this code isn't here, the program will come up and go away so fast that you won't be able to do it. This command is telling the program to wait until the right key is pressed it stop.
Well, I hope this was helpful. If there are any problems, please let me know.
Mon Feb 18, 2013 6:25 pm by Admin
» Where did everybody go?
Mon Feb 18, 2013 6:04 pm by Admin
» Dead Prosupply
Mon Feb 18, 2013 6:02 pm by Admin
» Site Comment
Mon Feb 18, 2013 5:57 pm by Admin
» Well, here we are once again.
Mon Feb 18, 2013 5:52 pm by Admin
» Topher's birthday party discussion
Fri Mar 16, 2012 11:32 am by Admin
» Game- ready model shops
Fri May 07, 2010 6:17 am by Tinlau
» I found it out!
Fri Mar 26, 2010 8:20 pm by Admin
» hello....?
Fri Mar 26, 2010 8:19 pm by Admin