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 / The DB Classic Programming Challenge Thread

Author
Message
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Oct 2008 09:30
user creates a script. the program reads the script and builds the menu for the user.

User's script:


Program then builds the proper menu when the program runs.


Irojo
18
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 3rd Oct 2008 17:16
Okay. I think I understand what your saying. That would follow with the challenge, however, the challenge is for making the fastest and easiest menu maker program. It is your choice.


I download memory.
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 3rd Oct 2008 19:10
I will enter this challenge, I've got and idea...

@Sinani
Off topic, I know, but how do you get that animated strip in your sig?


"To succeed is not enough, others must fail" - Gore Vidal
Turoid
22
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 3rd Oct 2008 22:14 Edited at: 3rd Oct 2008 22:18
Hello all!

Long time no see from me here. I've been bussy with a lot of commercial work last year. Anyway I like to share my entry for the 'menu maker' challenge here

I made a little program which lets you 'design' at minimum level to create buttons. You can position them and save the 'buttonset' to a file. Which you can use in your own projects. It is not really usefull though for creating 'nice-looking' menu's. But if you're making an editor of some sort, it can come handy.

This is the 'editor':



Left click on the buttons to move them around. Right click to change there text.

Here is a sample program which shows how you could use it in your own projects:

(You must create a buttonset file first offcourse )



Enjoy!


[EDIT]
I forgot to note that I have used some code for the text input from Ashingda's entry.

I am awesome and always right.
Ashingda 27
18
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 3rd Oct 2008 23:36 Edited at: 3rd Oct 2008 23:36
Quote: "I forgot to note that I have used some code for the text input from Ashingda's entry"


Well I'm glad you found something I wrote to be useful
Sinani201
19
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 4th Oct 2008 02:29 Edited at: 4th Oct 2008 02:32
Quote: "@Sinani
Off topic, I know, but how do you get that animated strip in your sig?"


They're called userbars. Get them at userbars.be (for some reason linking didn't work), then go http://ubanimator.com/ to put it all into one little strip.

I made my own userbar for DarkBASIC, but unfortunately I wasn't able to get it in the animated one. It wont show up if you search for it, so click here to see it.


"I reveal my trap card, GEORGE DUBYA BUSH!
America loses 2000 Life Points! America loses." -Deucalion2
Turoid
22
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 4th Oct 2008 13:27
Quote: "Well I'm glad you found something I wrote to be useful"


Very usefull! I always had problems with text input in db. I only used 'input' before because all my inkey$ attemps to get proper input-in-a-text-box always failed. But yours seems to be quite good!


NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 4th Oct 2008 13:47
Thanks Sinani!

Testing...


"To succeed is not enough, others must fail" - Gore Vidal
Turoid
22
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 4th Oct 2008 19:07 Edited at: 4th Oct 2008 19:12
Alright.. I went kinda nuts with this one

Added a sort of window system. You can now create little 'windows' and put buttons in them!

Editor Instructions:

You first need to create a form to put buttons on. Use 'Add Form', and click where you want to place your new window. To rescale it, use the little box in the bottom-right corner. You can also rename the form's title by right clicking on it. Then start typing.

When you have 1 or more forms you can add buttons. Click on 'Add Button', and then place it in a form you want. To rename it, right-click on the button and start typing. Press Enter when done.
You can also reposition them by just clicking on them.

The delete functions are self explainery. Click delete.. then click what you want to delete.

In the save/load filename window you have to enter a file WITH (for example) .txt extension.

You can create new forms any time you want. Also in an already saved/loaded file. Same for the buttons.

Here is the editor code:


I also made functions which you can use for your own projects. I.e. an editor or simple presentation software of some sort.

Here is an example of how you could use them:




The file which you need to run the example is attached to this post. It was created under a minute with the editor.

I'm done with it. Could add lots of more functionality to it. But it would be more of the same. And on top of that it is very easy to add extra funcionality yourself

There are a few bugs. I haven't made any depth sorting for the windows, thats why you can't move the windows in the example program. And you must be carefull with the sizes of the forms.. Buttons can stick out of them etc.. and then become unclickable.


Ashingda 27
18
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 4th Oct 2008 19:18
@Turoid
Wow great work! and Darn you, I have to update mines now! Will post later after I get cracken.
Sinani201
19
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 4th Oct 2008 19:37 Edited at: 4th Oct 2008 22:05
@Turioad
Your windows system reminds me of OBese87's Windowed GUI. It's very good! However, I don't see how it counts as a challenge entry; It's not really a menu screen,


"I reveal my trap card, GEORGE DUBYA BUSH!
America loses 2000 Life Points! America loses." -Deucalion2
Turoid
22
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 5th Oct 2008 00:45
Hmm.. What is the definition of a Menu Maker Program then? There isn't anything written about what kind of menu it should produce.

Irojo wrote:
Quote: "You are supposed to make a Menu maker program. This includes buttons."


I made a program which lets the user creates buttons

And have you seen the 'menu' from the first '99 unreal tournament maybe? thats filled with little windows.

But yeah.. Its up to Irojo to decide. Maybe mine is more GUI-ish.


Irojo
18
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 5th Oct 2008 02:56
The easier to use, the better.


I download memory.
Ashingda 27
18
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 5th Oct 2008 05:10 Edited at: 5th Oct 2008 05:16
Updates to my entry. Because Turoid had to go all crazy I had no choice but to improve as well.

@Irojo
This is actually a pretty good challenge, although I find the project itself to not be much of practical use, it sure forces you to learn alot! I advise everyone reading to take a shot at this especially the noobs.

Short List of updates:
-Can create multipule buttons now
-Added a "Delete Button" option
-Well it's just easier now... etc..

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 5th Oct 2008 12:30
Quote: "although I find the project itself to not be much of practical use"

Really? That surprises me a bit. A well designed gui/menu/form maker can be invaluable if you are ever designing any applications/games that need some kind of user interface. Grabbing and dragging around some buttons or objects even as place holders can save you so much time in design layout. And if it exports to code or to a script that can run on it's own or be loaded, it can be a big help.

Turoid & Ashingda 27, your apps are looking pretty good! Looks like the competion of this challenge is heating up. Keep up the good work; and I hope some others take a stab at this!

@Turoid
I was thinking along the lines of a form editor/creator as well - though buttons and the like could be independent of the form so it could serve as just a button clicking menu interface as well.

If I get some time I may have to do battle on this challenge with you guys -

Enjoy your day.
Irojo
18
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 5th Oct 2008 17:44 Edited at: 5th Oct 2008 17:47
As I've said in another thread, I can't access dark basic, so if by the deadline, I still can't, I'll send it to someone else.

This is excellent that people are entering again! The thread was slowing down too much.

And, as Latch said, the idea was to make an easy to use menu maker system. Which saves loads of time. Making the correct coordinates and everything for detection can take ages.

I don't know if anybody has this yet, but a sort of grid system would be nice. So you can line buttons up properly. Like in some programs, it locks the mouse in the middle if you get near enough to it.

I believe this can be done by:

x=mousex()/screen increment*same increment

Correct me if I am wrong.


I download memory.
Turoid
22
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 5th Oct 2008 18:20
Quote: "I don't know if anybody has this yet, but a sort of grid system would be nice. So you can line buttons up properly. Like in some programs, it locks the mouse in the middle if you get near enough to it."


I did that in my first version of my entry Click on 'snap' then the buttons will snap on a sort of invisible grid if you move them around. I have planned this to do in my next update...

Ashingda, Looking very good! Much better than your first app. I'm going to update mine again too You inspired me haha..


Ashingda 27
18
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 5th Oct 2008 21:15 Edited at: 5th Oct 2008 21:16
Quote: "Ashingda, Looking very good! Much better than your first app."

Thank you.

Quote: "I'm going to update mine again too You inspired me haha..
"

Sure the game's up!
BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 6th Oct 2008 04:57 Edited at: 6th Oct 2008 05:05
Ok, was holding off until I got my save function ready.

The code is really long so I attached it. The idea of this is that the menu code can be copy/pasted in or otherwise integrated with other programs. So the subroutines for each button are empty so that you can add your own code for different actions.

Only some of the buttons work, here they are:

Menus: File, Edit, and Add

File->Save (saves the code)
Add->Function Button
Add->Background image

A note: Do not use spaces in your button names, it will create an error in the generated code. Going to throw that fix in soon.

To use it, just choose the option in the menus. For the buttons (only one works for now) click and drag a box onscreen to specify the dimensions and start point of the button. Then type in the name.

Also, you can click and drag buttons around.

Still to add:
delete code (while the sprites can be deleted, I need to write functions that will shift all data in the arrays to fill the newly made gap).

Code for the rest of the add items

Code for undo/redo

(Maybe) Code for saving and loading incomplete menus for further building.

Note 2: While it WILL delete the new directory for all the files, due to a weird DBC glitch, it will not actually remove the file until DBC closes. As a result, you will only be able to save it twice without error. After that, you need to manually delete the $temp folder.

Note 3: Saving the code takes a while for some reason. Expect it. I turned sync on so that you will know that it is done because the mouse moves and it says "done" in the top right corner. Still working on a fix for this problem.

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Ashingda 27
18
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 6th Oct 2008 06:29
@BN2
Glad you can join this one. The first entry is always the messiest looking forward to updates.
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 6th Oct 2008 19:01
Everybody's entries are looking really good!
I'll enter my entry as soon as it's ready.


"To succeed is not enough, others must fail" - Gore Vidal
Irojo
18
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 8th Oct 2008 23:50
I got a new charger guys, so I WILL be judging. I will check out everyones entries right now.


I download memory.
Ashingda 27
18
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 9th Oct 2008 00:04
Cool glad to have you back.
Irojo
18
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 9th Oct 2008 00:17
Thanks Ashingda.

@Everyone
Here's how I feel so far about the codes:

Ashingda- Very nice saving, clean interface, though buttons are simple. I like the way it saves it into the DBA file. A name input would be nice.

Turoid- I like the snap button feature, put it in the newest version! The buttons are clean. The saving however did not work.

BN2- Very nice toolbar area. Though I find it unlikely to be needed, buttons can not be seen/put in that area, which is slightly inconvenient. I like the background image option - Very clever. And the REMs for which button is which is a very useful touch.

Glad to see everyone is entering!
I'm not going to give any suggestions yet, can't wait to see where it goes. Interested to see your idea Nano!

-Irojo


I download memory.
BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 9th Oct 2008 03:00 Edited at: 10th Oct 2008 01:31
All right, here is an update.

Function Buttons still work

Menu Buttons now work

Text boxes work, but still need a little tweeking. Controls are F1,F2,F3 to justify the text left center or right (respectively) and +/- to increase/decrease the size. Color changing options to come.

Deleting works, just right click on the object to delete it.

Moving works. Left click and drag on an object to move it.

Code attached

[edit]

Fixed 2 bugs:
1.Program should be able to be tested infinitely now, so you won't have to exit dbc to continue testing it.
2.Moving didn't save correctly. Now it will correctly position things.

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 12th Oct 2008 10:35
Everybody - looking good!

I started working on an interface designer. The goal was to be able to create the interface designer with the same tools that could be used to create any user interface. The interface could be a form or set of forms, buttons, text boxes, etc. Also there are some ornaments like fill colors and gradient boxes, dividers, etc. But I spent so much time putting together the gadgets, that I haven't actually yet created the drag and drop method to draw the gadgets on screen. They can be hard coded, but no drawing interface. On top of it, I started to like the way it was turning out, so I keep spending time tweaking things, expanding the source, and swapping in and out code... it's growing a bit too big to be fit for these challenges. If I have time, I'll try and make a stripped down version, but I doubt I'll have an entry I'll want to submit within the time frame. But here's a couple of screenies. Nothing glorious but the whole interface was made with the same tools one could use to build their own menu or gui from the application.

Screenies attached.

Enjoy your day.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 12th Oct 2008 11:54
Looking very good, Latch! Can`t wait to test the code!

Suicide is away of telling God, You can’t fire me I quit !!!!!
Not_Maindric
18
Years of Service
User Offline
Joined: 10th Jul 2007
Location: Omaha, NE
Posted: 12th Oct 2008 19:19 Edited at: 12th Oct 2008 19:20
Holy crap.

I pressed latest post and it did not work, sorry, replied to old post.

Ignore me please.

Irojo
18
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 14th Oct 2008 17:28 Edited at: 14th Oct 2008 17:29
Contest is almost over...


I download memory.
Turoid
22
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 14th Oct 2008 23:18
I did make an update to my editor. Might be posting it in few mins.. but I did not got my form 'sorting' fixed..

It looks like Latch went crazy with his one hahah!


BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 15th Oct 2008 06:29
Here is the final version of my entry attached. Here is the total rundown of what you can do:

Function Buttons
Text Box
Menu Button (up to 10 items)
Background Image (.bmp or .png)
Background Music (.mp3 or .mid)
Save
Move items by clicking and dragging
Delete by right clicking
Increase text size when making a text box with the + button, decrease with the - button.
Pressing F1,F2,or F3 will justify the text Left,Center, or right, respectively. WARNING: Don't let your text go off the edge of the screen. Consider yourself warned.

Saving takes about 15 seconds and will display the word "done" in the top right when it has completed.

Please note, save the file with the same name, as it is necessary for the program to save correctly.

Code attached.

It isn't that much different from my last post, just re-wrote the text box function and added the background music feature. Let me know what you think.

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Irojo
18
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 15th Oct 2008 15:09
Nice Entry BN2!


I download memory.
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Oct 2008 18:19
When's the deadline?

I still don't have a functioning add control interface... don't think I'm gonna make it on time...

Enjoy your day.
Irojo
18
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 15th Oct 2008 21:14 Edited at: 16th Oct 2008 06:51
14th midnight.


I download memory.
Irojo
18
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 16th Oct 2008 00:07 Edited at: 16th Oct 2008 22:35
Sorry to post twice, but it's kind of important to let everyone know the challenge is almost over, and it's at the top anyways.


CHALLENGE IS CLOSED!!!



By the way nano and Latch, I'd like to see your finished entry even though the contest is over.

Results


Turoid- Loading worked, however saving did not. It seems to not have made the code to post into a program. Great interface, excellent set up, and good theory! Some color options would have been nice.

Ashingda- First to enter, it started the competition going. Got the concept completely, saving worked wonderfully. An option to snap buttons into place would have been nice. Great text input function too!

BN2- Second version was excellent. I had some problems with saving, three commands were used for enhanced:

clear entry buffer - 2
entry$() - 1
--
I think after deleting that, the second versions saving didn't work. Excellent loading, I like the loading image and loading music. Good set up, and tons of potential. Your first entry worked in loading, so I'll judge that one.


Alright. I'm glad so many people entered! Pity you couldn't finish some of your programs and update yours (Turoid)

But the results:

Runner up:


Winner:


And seriously great concepts everyone!
Over to you winner!!


I download memory.
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 16th Oct 2008 22:03
Congratulations BN2!

@Irojo
I was making a dropdown menu wizard with customizable appearance. I got to well over a thousand lines, and it's still in it's early stages. I ran out of juice because, although I had written a lot, the outcome wasn't that great - most of the code was spent on GUI and methods of input. I tried to make it look as much like a windows wizard as possible, which did mean loads of work.


"To succeed is not enough, others must fail" - Gore Vidal
Irojo
18
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 16th Oct 2008 22:33 Edited at: 16th Oct 2008 22:34
I can see how you'd get tired of it. It's alot of coding for such a simple outcome. :S


I download memory.
BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 16th Oct 2008 23:21
Thanks! Will have a new challenge posted soon.

Lol, didn't realize that those were enhanced commands

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Irojo
18
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 16th Oct 2008 23:59
Quote: "didn't realize that those were enhanced commands"


It's hard to know what is and isn't.


I download memory.
BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 17th Oct 2008 09:40
Alright, let me know what you guys think of this:

Chase and Evade Ai

Basically, make a demonstration of chase and evade ai. This could be as simple as both just going in a straight line forever and ever (please no, that would suck) or as complex as you want.

Bonuses:
-The two objects leave a trail so that they can be followed
-Technique
-Axes used (2d or 3d)
-Wow Factor
-Chaser catches evader (only if the evader travels as fast or faster than the chaser)

I will set this challenge at 2 weeks so

DEADLINE:
Thursday, October 30th.

Here are a couple motion systems you can use if you don't know where to start:

-If the evader has a greater x, go right, if less, go left. Same goes for up and down
-Thrusts can be used but will be a little more challenging. So if the evader is to the right, apply a right force until pointing at them.

So there you are, have fun, if you think this is too challenging, I could think of something.

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 17th Oct 2008 09:43
No, I like this. I will certainly join this challenge. Good challenge!

Suicide is away of telling God, You can’t fire me I quit !!!!!
Turoid
22
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 17th Oct 2008 17:11
Congrats BN2!

Challenge sounds good. I'm going to try to get something done for this one too


Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Oct 2008 20:07
I'm thinking of an automated pacman


Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 18th Oct 2008 00:34
Quote: "By the way nano and Latch, I'd like to see your finished entry even though the contest is over."


Kinda the same story as Nano. My code was getting bloated pretty fast... the file selection was over 500 lines itself, and with all the gadgets it was close to 2000 and not finished. After the main gui design, It was hard to keep up motivation.

But anyway, as this new challenge sounds a bit like a couple of previous ones, here's an old submission that sorta applies to this challenge:

Blue just wants to take a walk and enjoy the day. Blue's cousin Red however, always wants to play and just can't leave Blue alone. When Blue is fed up with Red, Blue tries to take off running but always runs out of steam.



Enjoy your day.
Digger412
18
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 19th Oct 2008 00:26
I may join this one...I'm pretty new to forums, but I know my way around a lot of the code..Here's a little 2-D Chase/Evade that I wrote, nothing much, and I'd have liked to be able to find where my blue guy (evader) would be, instead of siccing red (chaser) on where blue is..You could do something like that in 3-D, use point object then find if your chaser is left/right, up/down of the evader and point him where the evader will be..will probably work on trying that next.

BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 19th Oct 2008 04:58
Wow guys, those are both pretty good!

Nano, I like the text in yours, its pretty funny.

Digger, thats really good, would be better if it were a little smoother, mainly the red guy, but still pretty good.

Looking forward to see what everyone comes up with.

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 19th Oct 2008 13:14
Great challenge BN2!

Quote: "Nano, I like the text in yours, its pretty funny."

I think you mean Latch.


"To succeed is not enough, others must fail" - Gore Vidal
BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 19th Oct 2008 18:51
OOOPS lol, I seem to have a problem of looking at the wrong names

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 19th Oct 2008 19:21
Thanks!

Enjoy your day.
Digger412
18
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 19th Oct 2008 21:41
@BN2

Thanks, I was going to work that out, then maybe make a 3-D one, just to get a feel of how it'd work, I've never done AI's before personally..this is a good learning experience, though.

Login to post a reply

Server time is: 2026-06-07 14:33:10
Your offset time is: 2026-06-07 14:33:10