Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / New comer, Need some help :)

Author
Message
Sp33d
18
Years of Service
User Offline
Joined: 9th May 2006
Location:
Posted: 9th May 2006 19:32
Hello, I'm COMPLETELY new to DarkBasic Pro, i know ABSOLUTELY NOTHING about programming games, I would really (I mean REALLY) appreciate it if someone gave me a step by step tutorial on programming games. I read several of them but I get lost when they start talking about variables. I would like one that explains it in-depth. Thanks.
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 9th May 2006 21:28
I think theirs a really indepth tutorial for making a shoot 'em up game somewhere on this forum. Shoot 'em ups pretty simple to program.

Their are loads of things around the web. I looked in the further tutorial section on the little booklet I got with mine (this is with DBC not DBP, might be diferent). That got me started.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 9th May 2006 22:30 Edited at: 9th May 2006 22:31
The tutorials on my web site are aimed specifically at people like you so you should check them out (link below).

My tutorials are aimed at DBC programmers, but as you say you have no programming language experience at all, I think that most normal tutorials will not give you much info about how the basics work - and that side of things is common to both DBC and DBPro, so my web site could prove useful for you.

Any feedback on what you think would also be greatly appreciated.

TDK_Man

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 10th May 2006 01:53
@Sp33d: I'd be willing to help you, what exactly do you need help with? Variables is one thing you mentioned:
Variables:
Don't know how much math you know, but variables are simply pre-algebra. A variable is pretty much a letter (or letters) that stand for a number or letter value. For a simple example:

would print "hello" (as it says), then wait for you to press the key before exiting, likewise:

would do the exact same thing, only using a variable (a$) to hold the value (or letters), which can be called up later in the program.

Types of Variables:
Float-denoted by a number sign (#) at the end of the variable (I believe its at the beginning in Dark Basic Classic). This variable is special because it can hold decimal values. Wheras "a = 2.45" would display "2" if you executed "print a", "a# = 2.45" would show a "2.45" if you were to execute "print a#". Get it?
String-denoted by a dollar sign ($) at the end of a variables (ie: a$). This variable can hold letters instead of numbers (and it could hold numbers, but in a letter form, lol, its confusing, but you'll get it eventually). I hope this isn't to simple for you. So, for example, "a$ = "hello" (like our first example), would display (when printed using "print a$"), "hello".
Regular-dont know what the proper name is, and I dont really care lol, I guess integer, but all this is is storing a number with no decimals, so "a = 1", when printed would display "1". Simple enough.

Those are the three main types of variables (that i ever use at least). You can also use more than one letter to represent a variable, so instead of just "a", you could also use "object" or anything else. So, for some examples:

Float

to get more complicated, you could do something like:

so the computer should make a cube, 1 unit (as you defined by the variable "objectSize"), with the object number as 1 (as defined by the variable "objectNum". Then with the "do...loop" your telling the program to loop continually forever until you exit the program, or exit the loop with a special command, so it is continually moving your object the speed (defined by variable "speed#") forward.

Hope all that helps, I probably just told you a bunch of stuff you already know, lol, oh well.

Pirates of Port Royale
Live the life of a pirate.
Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 10th May 2006 02:49
Check out programming principles, it will tell you a lot of things about programming like datatypes,varibles,operators,common statements, ect.

NARUTO IS THE NINJA.....not really

WIP...4 Elements
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 10th May 2006 04:58
Quote: "
I think theirs a really indepth tutorial for making a shoot 'em up game somewhere on this forum. Shoot 'em ups pretty simple to program.
"


Schweet FPS Tutorial

Sp33d
18
Years of Service
User Offline
Joined: 9th May 2006
Location:
Posted: 10th May 2006 20:11
Thanks a LOT!! For all the help from all of you, I really appreciate it, I'm starting to get the hang of it. I will eventually become an expert. @TDK, your site was very helpful!!! Its the one i've been reading the most. You should really make it more public so other people can view this great site. Once again, thanks for all the help, really appreciated.
Sp33d
18
Years of Service
User Offline
Joined: 9th May 2006
Location:
Posted: 11th May 2006 05:02
Ok, I just got started today, and Im currently on Variables. I understand Variables, Integer, Real #, Strings. I need help with Arrays I was understanding it until I got to Arrays, I need help with this please. Any tutorials would be appreciated.
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 12th May 2006 01:30 Edited at: 12th May 2006 01:31
ok, arrays, to me they are confusing, but I understand them . So, quoting DBP help:
Quote: "This command will create an array in which you can store your program data. You are able to create arrays with up to
five dimensions. Arrays are best visualized as a line of boxes. Within each of these boxes are even smaller boxes.
Contained within each of these smaller boxes are single items of data. To locate the data contained in one of these
boxes, you must indicate exactly which box you wish to read from or write to. Each box has what is called an index
number. Starting with the largest boxes, you provide an index number that takes you inside a box. You can then provide
another index number that chooses one of the smaller boxes within the larger box. Every time you enter a new box, you
are in fact indexing a new dimension in the array. Using this method of indexing the array elements, you can read and
write to any value within the array. You can store only one type of data per array. Data types include integer numbers,
real numbers and strings.
"

Arrays are used for storing information about things without having a seperate variable for all of them. So, instead of:

you could do this:

Its just easier to keep track of . Now, something I use often in programming is arrays with types. First of all, what is a type? I think of a type as your own custom variable. It's best used to store different data about an entity (object, character, etc.) in the game. For a simple example:

your creating your type, "characterInfo", and indicating its name, number, and life within the type. So, if you wanted to use an array with the type, you could do this:

It may seem complicated at first, but this is what your doing...First your making your "type" (like i said, think of it as your own custom variable, that holds more than one value), then from that type your creating an array, which will hold information about your characters. I created an array from the type that I have defined, which you will call up later. Its important that although I named the "characterInfo" after the "dim" and the type "characterInfo" the same thing, that isnt necessary, it just helps me keep track of which dim is with which type. I could have named the array "characterStats" or whatever else I wanted. So, whats the advantage to doing this? So you can easily keep track of and call up information. Oh, and I'm making 2 characters by making the number of "boxes" in the array 2. Here's an example of it all together:

So, whats this doing? First, we made our type that stores the character info, then we made an array to store information about each of our characters, and then we defined that information just like we would variables. When I typed "characterInfo( 1 ).name = "Bob"", I was defining the first character's name (in this case, this could be used for anything, food, items, horses, whatever you want), and with the "characterInfo( 2 ).name" I was defining the second characters name. When recalling info from types, use a period to seperate each variable. So, I hope your following me. Oh, and in case your wondering why i used the "as" statements to define the type of my variables instead of a "#" or "$", its just because theres more than one way to do it, and really, using an "as" statement is the better way, so you dont have to constantly add a "$" or "#" to the end. So, for a last example pulling together everything about types, arrays, and variables, heres some code:

What your doing is simply making characters (cubes) with the properties of each of the defined characters. Hope you understand . Feel free to ask questions you have .

Pirates of Port Royale
Live the life of a pirate.
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 12th May 2006 13:41
I read a good explanation of what an array is. You can compare it to a "variable that stores variables", even though thats to make it alot more simple then it really is. You can say like this: An array is like a book. the letters/words are the variables. The first number is the letter/word you currently read
. The second number is which line you are on
. Thie third number is which page you are on
, and so on.

The book comparation is the one I read, the otherone I made up myself. Goodluck.
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 12th May 2006 17:56 Edited at: 12th May 2006 17:58
An array is like a series of boxes of information, stacked in up to 5 dimensions. This would be like a three dimensional array.



Insanity is just a state of mind
Sp33d
18
Years of Service
User Offline
Joined: 9th May 2006
Location:
Posted: 15th May 2006 14:26
Thanks a lot, for all the help, I understand it now. I will be writing my first game soon!! Thanks for the help guys, really appreciated.

Login to post a reply

Server time is: 2024-11-27 19:45:48
Your offset time is: 2024-11-27 19:45:48