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 / An educational challenge to all new DBPro learners!

Author
Message
Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 3rd May 2011 03:42
Ok, this discussion gives away the solution to repeating music, but at this late stage in the challenge that's ok. Here's the code that I used to get repeating music:



This works perfectly on my machine. I'm working with version 1.073.

Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 3rd May 2011 03:45
It may be just about time to release some solution code for the entire challenge, too. Are people still working on this who don't want the solutions posted? If people are ready, I'll post my complete solution code and ask all the current entrants to post their complete code too.

Are we ready for the solutions or does anyone want us to wait while they work on it?

Wyldhunt
15
Years of Service
User Offline
Joined: 27th Sep 2009
Location: The Dark Side
Posted: 3rd May 2011 04:07
Unfortunately, I had a run in with real life and real life won.
I haven't had a chance to work on this since my last post, and I may not have another chance for a while. I'm fairly sure I figured out how to do it all. I just didn't have time to sit down and do it.
Since I don't know how long it'll be before I have a chance to sit and write any code again, don't worry about waiting for me.
If I manage to finish it, I'll still post my entry with my own code. I have the bees, I mostly just need to throw in the sounds and music.
jaccar09
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location:
Posted: 3rd May 2011 06:33
@Agent: yes i did use a UDT for the bees' location. also, i just noticed my code now and here's my repeat solution for the music



haha, i didn't notice what was wrong until i saw 1 instead of 99 for the music number. i didn't check if it repeated so yeah. it's ok though, at least i learn a few stuff here.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 3rd May 2011 11:09
@Agent:
Sorry for any spoilers, wasn't thinking. I just thought I'd found a bug and wanted to know if it was the same for everyone.

Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 3rd May 2011 11:29
I've emailed my source code to you Agent, probably in your junk-mail box.

I'm happy for a code unveiling if everyone else is.

Sometimes I like to use words out of contents
Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 3rd May 2011 21:43
I am definately getting no further in this so i am happy to see the source code, i just cant crack certain things but im happy that my music code was correct yet bugged, or actually i suppose im not really happy about that, something that simple shouldnt be bugged.
Arcmage
14
Years of Service
User Offline
Joined: 20th Apr 2010
Location: Pluto
Posted: 4th May 2011 04:21
I tried to use that music code but it did not work for me. Good to hear that it was not just me. I ended up just using a timer to loop the music.
Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 12th May 2011 06:24 Edited at: 12th May 2011 06:25
Ok, guys, I feel that enough time has passed and people have had sufficient opportunity to have a crack at this challenge.

Here is the code that I used to solve my own challenge. It is heavily commented so I hope everything explains itself, but if there are any questions please fire them at me. I am always happy to help padawans!

Here it is:


=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 12th May 2011 11:20
Looking at your example Agent, I feel like mine is a little long winded and overly complicated, but here is my code anyway



P.S.

Please note how I am using a UDT, and my Bee's do move in 3D lol

Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 12th May 2011 11:54
wow, my codes a bit crap by comparison, but the whole point is learning, and all the stuff I got wrong and misinterpreted has given me new stuff to work on. here's my code




have learned some new tricks attempting this challenge.
thankyou
kezzla

Sometimes I like to use words out of contents
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 13th May 2011 02:31
Here's mine, my bees also move in 3D like PRoF but the coding is totally different. I'm too lazy to put remarks on it, but you're welcome to ask any questions. I also learned a bit from this project .



Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 13th May 2011 06:19
Wyldhunt pegged my sticking point that I have been working on for a couple of days to no avail...the 2d mouse location based on screen size vs. the 3d coordinates used by DarkBasic. I am posting a quick sample of what I have come up with so far, but I think I might have an idea rolling around in my head on how to solve that.

With the default FOV of a camera at 90 and using the screen size, I think I can program up a function based on the location and angle of the camera in 3d space and project out an imaginary "bounding box" so that you can check to see if the object is in the FOV. I am unsure of the exact coding but will let everyone know if I come up with something that works.

I am not new to programming, but new to Darkbasic and this challenge has definitely helped learn!!!! Would be nice if we had a new one every month in the noob section

--give it a couple of seconds to load and use the left button or just move the mouse to bring the bees to you, use the right button to move mouse without bees being attracted.

Attachments

Login to view attachments
Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 14th May 2011 02:11
duh, didn't realize it was "over". Didn't finish, but here is the code
Matija the n00b
14
Years of Service
User Offline
Joined: 2nd Aug 2010
Location: Croatia
Posted: 23rd May 2011 22:11
OK, this was a funn and usefull challange but
Agent when are you going to post another one?
Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 24th May 2011 03:38
Alright, I will put together another one Stay tuned!

enderleit
17
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 30th May 2011 20:33
My solution is attached to this MSG!

It was fun...

Attachments

Login to view attachments
Stormwire
14
Years of Service
User Offline
Joined: 3rd Sep 2010
Location:
Posted: 4th Jun 2011 00:16


That's all it takes to stop a program eating an entire core? The core eating has been driving me nuts for awhile now lol Is there any problem using this method? What is going on with it exactly? Thanks for this thread it has been a great help
Wyldhunt
15
Years of Service
User Offline
Joined: 27th Sep 2009
Location: The Dark Side
Posted: 4th Jun 2011 00:35
The sleep commands halt the loop for the specified number of milliseconds; in this case, 1 millisecond. So, each time the screen syncs, it allows 1 millisecond for the processor to catch up on any other background processes that may be running.
Your program will run a tad slower, but it's not generally enough to introduce a game ending lag.

Login to post a reply

Server time is: 2024-11-16 21:47:48
Your offset time is: 2024-11-16 21:47:48