This is the first part of our tutorial series. In this tutorial we’re going to make our first program. So open up DarkBASIC Professional and we’ll get. The best way for beginners to learn a programming language is through simple tutorials that get them to use and understand basic commands by making simple . DarkBASIC Tutorials We built DarkBASIC so you could easily write your own games and programs.
|Published (Last):||16 October 2006|
|PDF File Size:||16.92 Mb|
|ePub File Size:||5.74 Mb|
|Price:||Free* [*Free Regsitration Required]|
The half way point, finally after all that coding and reading and days.
This chapter we’ll be making a text adventure using more text commands you’ll now learn. Plus you’ll learn how to clear the screen darkbasid various colors, and oh boy you’re gonna enjoy this lesson.
I’m a Canadian yutorial I still spell color as color instead of colour. What’s the RGB for? It stands for Red, Green, Blue, look at your monitor with a lens you’ll see lots of those pixels in those colors.
Dark Basic Tutorials
The rgb must be separated by brackets and then a comma for the transparency value. The transparentcy ranges from 0 to RGB values range from 0 to also. To see more have a look in paint, view the rgbs values and fool around that’s the way I found out, so you should find out too. Using these above values you uttorial be able to make ttutorial colors. The lower the value the darker, the higher the lighter.
Okay, now we’ve learned lots about changing text values it’s time to write your own text adventure. We’ll call it “Dungeons of Doom”, it’ll have the player to escape the dank dungeons of a castle using numerous data commands and whatnot. Evil Elves have captured you in their prison, now you must escape the Dungeon of Doom. Beware some turns lead to doom, others lead to a way out.
This game is complete, all things should work if not feel free to email me at: Now then your assignment to show you know what’s going on is to go back and add in comments describing what’s happening in each. The final part in your assignment is to edit all the code and data statements to make a sequel, add rooms, and more.
No this game is not a text role playing game, we’ll make a text role playing game in the next lesson. I think tomorrow your gonna have a break-out of game programming. Oh boy, oh boy, oh boy! We’re going to make a Pong game today, a BreakOut game today, and your going to learn about images, sprites and more! Remember in the file manager program we had some confusing formats of files in there.
One thing I didn’t add was animations unfortunately. Go look at some more examples of multimedia in DarkBASIC, some more are 3dsound, and you can play music off your cd too.
Make video games with DarkBASIC
We’ll dakbasic using some more examples of multimedia in DarkBASIC in darkbaskc chapters for now we’ll be focusing on the said above in the example. Your main question may be what is a sprite? A sprite is a 2d character that is used in games. You cannot use load bitmap and use that as an image for your sprite, futorial can only use images loaded by the load image command.
Before we start, if we leave the computer to take care of our game’s framerate then our game will run slow and differently on different paced computers. Use sync on, to turn the framerate over too you and away from the computer.
Every time the sync command is used the screen is updated constantly.
Use the sync rate command, to set the rate the frame refreshes, mostly 30 is good for 3d games in DarkBASIC, and 40 for 2d games is also good too, but use 30 to make darkbasicc. There are a few commands in darkbasic that draws crude graphics, the commands we’ll use are: They draw these graphics in the default ink, if the ink is not set it’ll use cyan as a default.
There are more commands that draw different basic 2d shapes, but we won’t be using them. Before we start I’d just like to thank everybody for visiting this wikibook, darkbaasic time to read it and tutorixl knowing when I google “DarkBASIC Programming” I see my book on the first page.
That’s a great feeling! I hope you learn something, I’ll try and get this book done very soon but I’ve been very busy with learning new things and my schoolwork. Okay let’s start with the pong game, I must say it’s been a challenge writing this pong game, I’ve had lots of bugs with it. Darkbaskc must use your own images, only the source code is included.
Understanding the Material Before I go ahead with the Pong game there is some things that I must, nay, need to explain to you.
Dark Basic Guides
First, of all you need to understand what a “sprite” is, yes I know I mentioned it but darjbasic has in depth as I need to now, again that was just a basic example.
Basically, put a sprite is nothing but an active image that allows more manipulation then standard bitmaps. In our terms, speaking a sprite is in most cases nothing but a 2d character. You already know how to setup a sprite. But you do not know how to delete sprites, how to detect collision with xarkbasic, and have not used them very much yet.
The syntax of deleting a sprite is simple: The sprite obviously must exist if not you’ll get tutorual runtime error stating that the “bob” or sprite does not exist. The same works for collisions with sprites: Again they must exist has I stated, and you must tutoriap two, again I’m stating the obvious but there are pretty dumb people out there.
The other way works the same thing except it’s not has precise and goes like this: What may not be so easy tutogial reading the code below is what the random numbers are for. These random numbers simply put are so that the computer generates a number from 0 to 1 in which direction the ball should go. They are for both X axis and Y axis and you should know what those are already. Okay now, for the answers, if you cheat your on your own after you have this book completed so don’t be a wimp and take the coward’s way out.