Hello everyone!
I am a starting programmer with little or no experience, and thus far I have been experimenting with Dark Basic a bit and Im starting on a small project to learn the basics, but I have a few questions that I need to have answered to continue the project.
I assume most of you know the game Minecraft, and I took that as a subject because it seems easy to make things out of that.
My idea was to make a program which allows you to see all the blocks in 3D by turning them around with the arrowkeys. No real practical use, but its good to start with and learn the basics.
This is my code thus far:
Set Display Mode 1280, 720, 32
Autocam Off
Sync On
Sync Rate 100
Load Music "music/Boo.mp3", 1
Load Music "music/Hal1.mp3", 2
Load Music "music/Nuance1.mp3", 3
Load Music "music/Piano2.mp3", 4
Load Music "music/Piano3.mp3", 5
Loop Music +1rnd(4)
Load Sound "sounds/sheep2.mp3", 10
Load Sound "sounds/chicken1.mp3", 11
Load Sound "sounds/sheep2.mp3", 12
Load Sound "sounds/pig2.mp3", 13
Load Sound "sounds/sheep1.mp3", 14
Load Sound "sounds/cow1.mp3", 15
Load Sound "sounds/zombie1.mp3", 16
Load Sound "sounds/spider1.mp3", 17
Load Sound "sounds/zombie2.mp3", 18
Load Sound "sounds/cow2.mp3", 19
Loop Sound +10rnd(9)
Load Image "images/blocks/dirt.png", 10
Load Image "images/bg/bg1.bmp", 1
Load Image "images/bg/bg2.png", 2
Load Image "images/bg/bg4.png", 3
Texture Backdrop 1+rnd(2)
Make Object Cube 1, 22
Texture Object 1, 10
Position Camera 30, 30, 30
Point Camera 0, 0, 0
Make Light 1
Position Light 1, 0, 30, 0
Do
If Downkey() = 1 then Pitch Object Down 1,1
If Upkey() = 1 then Pitch Object Up 1,1
If Leftkey() = 1 then Turn Object Left 1,1
If Rightkey( )= 1 then Turn Object Right 1,1
Sync
Loop
Lets just start with my first question,
Is it possible to implement 3D models like blocks instead of using
Make Object Cube 1, 22
Texture Object 1, 10
?
Second question,
I am trying to loop random sound effects on a timer, so far I have this,
Load Music "music/Boo.mp3", 1
Load Music "music/Hal1.mp3", 2
Load Music "music/Nuance1.mp3", 3
Load Music "music/Piano2.mp3", 4
Load Music "music/Piano3.mp3", 5
Loop Music +1rnd(4)
Load Sound "sounds/sheep2.mp3", 10
Load Sound "sounds/chicken1.mp3", 11
Load Sound "sounds/sheep2.mp3", 12
Load Sound "sounds/pig2.mp3", 13
Load Sound "sounds/sheep1.mp3", 14
Load Sound "sounds/cow1.mp3", 15
Load Sound "sounds/zombie1.mp3", 16
Load Sound "sounds/spider1.mp3", 17
Load Sound "sounds/zombie2.mp3", 18
Load Sound "sounds/cow2.mp3", 19
Loop Sound +10rnd(9)
My problem is though that the command
rnd does not actually makes the pattern random, it generates a pattern and follows the pattern each time it launches, so eventually it resumes where it started and follows the same pattern it did before. There should be a way to randomize it right? Also, I want to play random sound effects (ID 10-19) once every 60 seconds, but how do I do that?
My last question,
I want to make a menu with resolution settings and the choice to select certain blocks to be showed. So when I see a dirt block and I want to see a cobblestone block, I go to the menu and click on "
Cobblestone" and then the screen displays a cobblestone block.
Thanks in advance for helping me,
Ladathion
Learning to program with Dark Basic