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 Professional Discussion / Function Progression by Key

Author
Message
Video Game Based
11
Years of Service
User Offline
Joined: 5th Dec 2013
Location:
Posted: 5th Dec 2013 01:49 Edited at: 9th Dec 2013 06:19
I would like to execute my program by function. How do I move on to the next function without using wait key?

Here is a copy of my code:


I would deeply appreciate any advice on this issue.
mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 9th Dec 2013 13:38
Quote: "WAIT 20"

? Program executes step-by-step, you can't do A while B. A then B.

luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 9th Dec 2013 13:45
My advice: Discard everything you have.

Follow this:
http://forum.thegamecreators.com/?m=forum_view&t=137027&b=7
And this: http://forum.thegamecreators.com/?m=forum_view&t=115633&b=7
You can find some really cool stuff here: http://dbcodecorner.com/index.php?page=challenge&sort=startdate&order=DESC&p=8
Many people here have Hands on DBPRO book.I heard it's a good one.

When you have the base, start over.Learn how to walk before you start runing.

I can rewrite everything for you, or someone else could do it instead, but i doubt you will learn much from this.After 10 minutes you probably will hit another wall.

Before i had the confidence(and knowledge) to write a game i played with Code Snippets for a really long time.Then i make a game, it was simple,buggy one.Then i make another game...it was simple,buggy one.Then i make another one, no more bugs, but really simple one.Now i am making something challenging.I plan to make something big one day, but i won't fool myself, this might never happen.

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Video Game Based
11
Years of Service
User Offline
Joined: 5th Dec 2013
Location:
Posted: 9th Dec 2013 17:33
To everyone w/ this issue:

I will be posting my success, as I carry on.

I am using hands on dbpro(hob) I and hob II.

Again, Thanks for the input.
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 9th Dec 2013 18:30
If this is what hands on dbpro is teaching i'm glad that never read it.

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Video Game Based
11
Years of Service
User Offline
Joined: 5th Dec 2013
Location:
Posted: 10th Dec 2013 07:15
Games are Made more Efficiently And Productively in C++.
Broken_Code
14
Years of Service
User Offline
Joined: 20th Aug 2010
Location: Bremen, Germany
Posted: 10th Dec 2013 14:24
Just a quick tip:
Learn about indentation! It makes the code much easier to read, not just for you but for everyone who might help you!
For example, this:

is much harder to read than this:

(Lower/uppercase doesn't matter but I prefer lower )

Keep at it!
Bruce

"... Why the hell did I chose game creation as a hobby!?" - Burning Feet Man
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 10th Dec 2013 17:17
Same as Broken_Code said.
I was gonna point that out in my first post but i did not, because it was gonna be too much criticism to the new guy.

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Dec 2013 21:33
Do people ever use the newcomers board any more?

Newcomers to DBPro



Powered by Free Banners
Video Game Based
11
Years of Service
User Offline
Joined: 5th Dec 2013
Location:
Posted: 10th Dec 2013 23:26
So this is what I did, and my code is a step closer to SUCCESS!



!!Saluda guey!!
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Dec 2013 18:34
You'll get an error when you press 5 with that code. (Function declaration found or something like that.)
Please add an End after the Until No = 5 and you'll be fine.

Stab in the Dark software
Valued Member
22
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 11th Dec 2013 20:44 Edited at: 11th Dec 2013 20:47
Coding rules for DBPro.

1. ONLY use Do/loop for your main loop, all the other loops are not
optimized to be used as a MAIN loop.

2. Absolutely no Function declarations before your Main DO/Loop.
This is a big error in your first code snippet.

3. There should only be Function calls before the DO/Loop, no loose code.

4. The Main loop should only have function calls, no loose code.

5. Learn to indent your code.

These five steps will make the code easier to read and debug.
Writing code is easy and fast, debugging takes a lot longer.

P.S. Using the "END" command after the Main Loop is deprecated.

[img][/img]


WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 11th Dec 2013 20:45 Edited at: 11th Dec 2013 21:38
Quote: "If this is what hands on dbpro is teaching i'm glad that never read it."

*shocked* m-m-maybe it is okay book? I've never read it too though.

Dear Video Game Based! Your code is awful. That is not how functions should be used. That is not how everything should be used! You need to study basic code snippets and learn to make a proper structure. Code is your health and ammo, but structure is your map! You will die in the first dungeon without a map.

P.S. We've all done "hello world" at first, there is nothing wrong in bad code posting for a newbie. Live and learn! Good luck.

Later:

P.S. I recommend you to (buy) start with a Dark Basic Classic, because there are several very-very good micro-games as examples! They are fun and code is a good way to learn structure!

Micro-games as far as I remember them: goblin laser shooting, tank driving, goblin riding a wave runner.

Video Game Based
11
Years of Service
User Offline
Joined: 5th Dec 2013
Location:
Posted: 12th Dec 2013 07:09
I originally inquired advice on switching between encapsulations via called keys. For example, the main screen appears with options easy, medium, hard. One would use up and down arrow to switch between options and use global enter key (whichever key set as enter). Then, a key would be used to progress to the next screen, or section of the modular program, object, etc. Another key would be used to move to the previous screen, being the introduction screen(under construction). I think I'm doing pretty fly for a white guy. Sorry for the rant.

Again thanks.
Video Game Based
11
Years of Service
User Offline
Joined: 5th Dec 2013
Location:
Posted: 12th Dec 2013 08:38
Hey you,

Look into inheritance.

!!!You are a strong and worthy person!!!

Login to post a reply

Server time is: 2025-05-17 14:15:58
Your offset time is: 2025-05-17 14:15:58