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.

DarkBASIC Discussion / Help needed

Author
Message
BIGGINER HELP URGENT
18
Years of Service
User Offline
Joined: 4th Jan 2007
Location:
Posted: 4th Jan 2007 22:57 Edited at: 4th Jan 2007 23:14
I'm [MOD EDIT] I thought it would be cool to make a game but it seems imposible. I looked st all the tutorials on this site and recomended sites on one of the sites I was starting to understand arrays but then it al became confusing after reading the rest will some body help me but tr to help me with the best understanding you have because I have tried everything
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 4th Jan 2007 23:16
Please don't post your age on the forums - it isn't a safe thing to do, and makes almost no difference to programming ability.

Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 4th Jan 2007 23:29 Edited at: 4th Jan 2007 23:32
even though you dont 100% understand the tutorial.. just do it.. you will learn eventually..


i like pancakes..
BIGGINER HELP URGENT
18
Years of Service
User Offline
Joined: 4th Jan 2007
Location:
Posted: 5th Jan 2007 19:06
I have tried the tutorals will someone explain to me why you need those rem and all those coding signals I just don't get why you need so many symbols
BIGGINER HELP URGENT
18
Years of Service
User Offline
Joined: 4th Jan 2007
Location:
Posted: 5th Jan 2007 19:06
I have tried the tutorals will someone explain to me why you need those rem and all those coding signals I just don't get why you need so many symbols
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 6th Jan 2007 00:09
"rem" stands for remark... the short way of doing it is "`" (without the quotes). Those are only there to tell us what the program is doing... so if we go back to the program a couple of months, a few years or next century we'll know what the program is doing. Remarks are not read by the computer... their just skipped.

Without the stuff between the remarks the program won't do anything.

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 6th Jan 2007 01:58
don't double post.

BIGGINER HELP URGENT
18
Years of Service
User Offline
Joined: 4th Jan 2007
Location:
Posted: 6th Jan 2007 02:02
I just don't get it I got this software to make adventure games but I get confused how do you make a character and make them move
and how do you make a landscape I don't understand how many numbers make this the best coding I can do is PRINT "WHAT IS YOUR NAME?"
INPUT "NAME$;"
PRINT "HELLO THERE"
I still do not know how to make a reply with there name by memory I have to look it up
I have tried tdk's tutorial but I just don't get this anyone willing to help
BIGGINER HELP URGENT
18
Years of Service
User Offline
Joined: 4th Jan 2007
Location:
Posted: 6th Jan 2007 02:03
wiil anyone help I have tried tdks tutorials but nothing help
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 6th Jan 2007 02:10
Thats a tall order to start with. Break down your questions into smaller groups.

What specifically are you having trouble with?
Do you want to make a text adventure game, a 2d adventure game or a 3d adventure game?
Have you programmed in other languages? if so what were they.
Which of TDK tutorials are you having trouble with, what does not make sense to you.

Bluestar4
19
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 18th Jan 2007 04:18
first of all , read the included manual from the very begining then a lot of the tutorials will make sense. secondly,
if you would like to make a game in using 3d , you need to load animated 3d models with the load object command. The files must have a .X or .3ds extension.
once you have found a couple .x files (many are included on both the cd and electronic version) copy them to your projects directory and replace the part below where it says yourfile.x with the name of the file you have copied but do not forget to copy all files that the model uses such as bmps or dds files. If you follow these instructions you will have successfully loaded a 3d file, and made it look like its walking although it wont move anywhere until you insert the move object command but this shoud give you an idea of how to do it.
the reason why one needs to use rem statements is simply to make notes for what that part of the code does - so that if you dont touch the project for a few months your notes will tell you what you were intending that part of the code to do.


sirsiddy
18
Years of Service
User Offline
Joined: 15th Jan 2007
Location:
Posted: 18th Jan 2007 05:07
Its ok lol calm down Im young too, and this stuff is still real hard for me. But I get some of it and programing is really fun. You just need to practice as much as youu can and other stuff will come to you(of courselook up the commands lol). Practice loops, and drawing basic lines. Making calculators, number guessing games. These are all really basic things.
umm from memory here is a number guessing game... Look at it and try to figure out all the parts... expirement with it.
Oh and this probly isnt the best. alot of people will bomb on me because I used a goto command. lol
sirsiddy
18
Years of Service
User Offline
Joined: 15th Jan 2007
Location:
Posted: 18th Jan 2007 05:07
Its ok lol calm down Im young too, and this stuff is still real hard for me. But I get some of it and programing is really fun. You just need to practice as much as youu can and other stuff will come to you(of courselook up the commands lol). Practice loops, and drawing basic lines. Making calculators, number guessing games. These are all really basic things.
umm from memory here is a number guessing game... Look at it and try to figure out all the parts... expirement with it.
Oh and this probly isnt the best. alot of people will bomb on me because I used a goto command. lol
Bluestar4
19
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 18th Jan 2007 16:21
Quote: "alot of people will bomb on me because I used a goto command"


why is that ? most all languages has an equivilent of the goto command.

NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 18th Jan 2007 18:05
Quote: "I can do is PRINT "WHAT IS YOUR NAME?"
INPUT "NAME$;"
PRINT "HELLO THERE"
I still do not know how to make a reply with there name by memory"

If you want to do this all you have to do put ';' after the 'PRINT "HELLO THERE"' and put your name variable there. Like this:

PRINT "WHAT IS YOUR NAME?"
INPUT "NAME$;"
PRINT "HELLO THERE ";name$

Remember to put a space after the '"HELLO THERE'. Otherwise the screen would just look like this

HELLO THEREnamevarible

S3
sirsiddy
18
Years of Service
User Offline
Joined: 15th Jan 2007
Location:
Posted: 19th Jan 2007 00:27
It is kinda considered bad programming to use goto because on large programs, it gets extremely confusing. I think its alright to use it on small programs, other peaople dont.
Bluestar4
19
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 19th Jan 2007 05:53
interesting thing about that is , that it shouldn't be considered bad form at all. Every time someone uses a repeat-until loop its doing exactly the same thing as a goto , and the same could be said about the do-loop statement. I have a few large programs that I've done , and I used a goto statement or 2 because I needed a way to get to a speciffic part of the program without actually putting it in a repeating loop. They can be very useful if placed in the right spots in code. perhaps it does confuse a lot of people , but that dont make it bad form (in my opinion)

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 19th Jan 2007 18:40
Quote: "Every time someone uses a repeat-until loop its doing exactly the same thing as a goto"


Not really. A Repeat...Until is a loop. Goto is an unconditional jump to anywhere in your program and it's this leaping about all over the place that Gosub and functions were designed to alleviate.

What you have to remember is that Goto is a throwback to the days when you didn't have functions and Gosubs and as has been mentioned already, can lead to untidy code which is not easy to trace.

The whole concept of a procedural programming language is that you don't use Goto, so from that aspect, it's use can be classed as bad practice. In fact, some languages have even had the Goto command removed for that very reason.

I'll admit to being very anti-Goto and always advise users to avoid it as it's bad practice. Of course it's only an opinion and no-one can force anyone to do what they don't want to do.

All I can say is that in thirty years or so of programming, I've not used Goto in any major project during the last twenty of them.

To put it simply, there's no situation where you would actually have no choice but to use a Goto.

Quote: "I used a goto statement or 2 because I needed a way to get to a speciffic part of the program without actually putting it in a repeating loop"


I don't understand what advantage using the Goto would give you in this particular case. Why couldn't the code in question be in a procedure and called with Gosub?

I think a large part of the reason people use Goto is lack of planning prior to starting a project. It does take a little more effort to start a program in a modular fashion, but as it grows, that extra work pays off.

With regards to being OK in small projects and not in large ones, I suggest that regardless of project size, if it can be done without Goto then don't use it.

If it can't be done without using Goto, then please let me know because I've been after such an example for a long, long time...

TDK_Man

Image All
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 19th Jan 2007 22:19
Instead of just saying "I need help" try to make a simple game. Don't worry about if you don't know squat. When you run into a part that you don't know how to do, ask a very specific question on what it is that you want to do; not just "i must make pong!"

Bluestar4
19
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 21st Jan 2007 03:01
hello tdk hope you had a good day. I promise you that I absolutely planned for that goto label to be there so no lack of planning there . I usually place a label right before doing the code of the main menu screen. This gives me the advantage of being able to unconditionally jump directly to the main menu from anywhere in the program. its my opinion that goto has a great advantage IF used properly. . I would also like to point out that not everything printed in books is always accurately portrayed. For example, when you use a while loop in place of a repeat until loop in older c++ if you happen made a mistake in your code there was no way to break out of that loop short of manually terminating the program with ctl-alt-delete or turning off the pc , yet this method of coding was highly praised in several programming books as the prefered the way to write code for your program.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 21st Jan 2007 16:26
Bluestar4:

I suppose we could debate this all day lol!

Quote: "I usually place a label right before doing the code of the main menu screen. This gives me the advantage of being able to unconditionally jump directly to the main menu from anywhere in the program"


You are perfectly within your rights to use whatever programming method you like - including the use of Goto if you want. Don't get me wrong, I'm not demanding that an experienced coder changes the way they've written programs for years. (That experience allows them to avoid the dangers of using Goto that newcomers simply will not have).

You use Goto for a main menu screen. Fine - a lot do. In a procedural programming language, what I wonder is exactly why?

It's like when you use an Object Oriented programming language, you use OOPS methodology. Goto is simply a 'legacy' command left in for compatibility and isn't a part of structured programming so I just think it's best for newcomers to not use it.

Quote: "This gives me the advantage of being able to unconditionally jump directly to the main menu from anywhere in the program"


You could do exactly the same with Gosub and remain within the structured programming framework, so what's the advantage of using Goto?

I'm just suggesting it's a better way to have a Main_Menu procedure which contains a program control loop. This loop is never exited unless:

* The user selects 'Play Game' - at which point program control drops back to the main program loop.

* The user selects 'Exit' - at which point the program just ends.

You set up your program variables at the start then immediately Gosub the Main_Menu procedure. On exit from this, it returns and executes the main game loop. At any time you can Gosub the Main_Menu procedure to return to the main menu and each time, selecting play drops you back to the main game loop.



This method keeps all code for any given task in it's own easily identifiable (and locatable) procedure making it easier to trace and debug.

And to me, what's important is that it doesn't need Goto and adheres to the procedural programming ethic.

TDK_Man

SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 21st Jan 2007 17:52 Edited at: 21st Jan 2007 17:52
goto is only really needed in assembly, where you don't really have any other choice, or so I believe, at least...

DB is not assembly, so every time you bump your head on a goto command, there's probably a better, more efficient way of organising your code, which would eliminate your goto.
Bluestar4
19
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 21st Jan 2007 19:20 Edited at: 21st Jan 2007 19:22
its habbit I guess for me to do this as I used to do a little coding in 16bit assembly way back when dos compilers were king. I did look over the code of the program I was refering to and found that it could be re-coded to use a repeat until loop however I had another one that used the goto command and I wouldn't change anything on it because it wouldn't work if I did , and I have a favorite saying that goes something like this : if something aint broke, dont fix it !

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 21st Jan 2007 19:40 Edited at: 21st Jan 2007 19:42
When we were learning how to walk we first had to learn to crawl. Using "goto" is like crawling... using "gosub" is walking and using functions is running. We can still crawl every once in a while but why crawl when you can walk or run?

Edit: Not that I think people that use "goto" are immature... there are just better ways.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 21st Jan 2007 21:20
Quote: "if something aint broke, dont fix it"


Couldn't agree more!

When all is said and done, throughout all my inane ramblings, I've always pressed home the point that my comments are aimed purely at newcomers to programming so they learn good habits from the very beginning. (And the not so new if they want to improve their programs and make their lives a little easier).

Grog:

You've just got to love that sig logo!! Only wish I had space to use it myself...

Bluestar4
19
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 22nd Jan 2007 01:20
yes its quite a neat one isn't it lol

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 22nd Jan 2007 03:12
Thanks guys.

z3r0mind
18
Years of Service
User Offline
Joined: 11th Aug 2006
Location: Behind you...
Posted: 22nd Jan 2007 04:57
Hmm what happend to BIGGINER HELP URGENT? I think you guys scared him away with your little Goto debate.0.o
Medusa
21
Years of Service
User Offline
Joined: 7th Sep 2003
Location:
Posted: 5th Feb 2007 21:20
goto has a unique usage that programmers should know and just because most people don't know why it's used they somehow jump to the conclusion it should'nt be used.
Why would it be there unless necessary under special conditions?
If you anti-gotos want to give yourself a real challenge see if you can work out in what conditions goto is better than either gosub or function and in which special condition only goto will do the job?
As for beginners to programming:
Until such times as you are able to learn programming
entry into the world of gamemaking which the person puts emphasis on can be achieved with'3D Gamemaker' available from Dark Basic.
Regards

mpc
Bluestar4
19
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 6th Feb 2007 00:30
I couldn't have said it better myself medusa (although I tried earlier lol )

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 6th Feb 2007 01:07 Edited at: 6th Feb 2007 01:10
@ z3r0mind

If he came back he would of seen the help offered after his last questions.


@ Medusa

Quote: "goto has a unique usage that programmers should know and just because most people don't know why it's used they somehow jump to the conclusion it should'nt be used."


Most of us Anti-Goto people grew up programming in Basic and GWBasic and have used "goto" and eventually learned it's better to use "gosub" instead. Of course when functions first came out we used them and have never looked back at "goto" (or even "gosub" for some of us). We learned that "goto" shouldn't be used from years of programming experience.

Quote: "If you anti-gotos want to give yourself a real challenge see if you can work out in what conditions goto is better than either gosub or function and in which special condition only goto will do the job?"


Since everything can be done without using "goto" there is no possible way for us to prove "goto"s worth. It's really up to Goto-Lovers to prove something cannot be done without using "goto". If you find one be sure to post it so us Anti-Goto people can fix it to work better without that evil spaghetti code creating command.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 6th Feb 2007 01:39
Why would it be there unless necessary under special conditions?

It's a legacy command left in for backwards compatibility so that old listings from donkeys years ago will work when typed in.

I used Goto on the TRS-80 and old Atari machines back in the last century - only because back then we didn't have Gosub or Functions.

As soon as they appeared, most people saw that the Goto command was obsolete and stopped using it.

And, there is just one solitary situation where the use of Goto is acceptable - a code snippet demonstrating the use of the Goto command!

TDK_Man

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 6th Feb 2007 02:21
You had a TSR-80 too? Man we're old.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 6th Feb 2007 02:39
Quote: "You had a TSR-80 too?"


Yes - I remember that the wife wasn't too pleased when I brought it home from Tandy's either (Radio Shack for US readers)!

TDK_Man

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 6th Feb 2007 09:28
That's cool. Ah the good old days before hard drives and disks.

I could never understand why Radio Shack always thought their stuff was made out of solid gold. My aunt actually worked for them as a schematic drawer. Every time she would submit something they'd tell her to take out as much as she can to get the device to barely work (to make it as cheap as possible to make). Then of course they would charge the customers an outrageous amount.

BIGGINER HELP URGENT
18
Years of Service
User Offline
Joined: 4th Jan 2007
Location:
Posted: 22nd Mar 2007 00:05
sry I kinda gave up but i;m willing to try again thanks for your help guys can ayone explain what a variable is in the easiest way
BIGGINER HELP URGENT
18
Years of Service
User Offline
Joined: 4th Jan 2007
Location:
Posted: 22nd Mar 2007 00:05
sry I kinda gave up but i;m willing to try again thanks for your help guys can ayone explain what a variable is in the easiest way
BIGGINER HELP URGENT
18
Years of Service
User Offline
Joined: 4th Jan 2007
Location:
Posted: 14th Jul 2007 00:40
help

Login to post a reply

Server time is: 2025-05-26 02:49:50
Your offset time is: 2025-05-26 02:49:50