Hi new guys! Welcome to DBPro and our little community of programmers.
Over the last few months I've been helping several people build their budding programming skills, a couple of whom are learning to develop in DBPro. In my experience teaching people to code, I've found that many people want to jump directly into writing their very first Call of Duty or World of Warcraft clone. It's difficult sometimes to make an enthusiastic learner realise that making a game of such magnitude is not something a week-one learner is capable of! One must start the journey of becoming an epic codemonkey in the same place all journeys start: At the beginning.
So, I started challenging my padawans with little programming assignments, involving concepts that I know they do not yet fully understand. In order to complete the project, they have to acquire fundamental programming knowledge, practical command usage and basic logical accuity that makes them "think" like a program does as it's executing. By the time they've completed the project, they've learned a new structure, command set or logical process that is required in the course of creating games.
I've decided to set one of my favourite challenges loose upon the world of up and coming DBPro aspirants to see if people find it a useful learning tool. To some, it may sound like a very simple and pointless "That's Beneath Me!" assignment, but there's much more to this challenge that it may seem and in reality most of my padawans fail horribly on their first attempt.
I want to see how
you fare! If your existing knowledge fails to provide a quick solution to the problem, then by figuring out how to solve it you will have learned some of the basic essentials to game making.
Here's the assignment... The completed program will:
1) Create a swarm of 'bees' whose movement can be controlled by the mouse. Each bee will be a three dimensional cube (or, if ambitious, any small 3D model as imported from any relevant data file), and the swarm will be tightly clustered as if swarming around the mouse cursor and following it around. The formation of bees must be in a random dispersal in three dimensions and number no fewer than fifty.
2) Feature a background image for the bees. An image file must be used for this, containing an image that is smaller than the size of the program window. The image must be resized by the code itself to exactly the correct dimensions to fit the window.
3) Play a different sound each time the left mouse button is clicked. No fewer than three unique sounds should be utilised. The sound must not play more than once per click (no "thousand-sounds-a-second" outcomes).
4) Produce background music in MP3 format that will continue to play after the end of the song.
5) Terminate when the user presses the F1 key. Termination via use of either the ESCAPE key or the X button in the caption bar is to be prevented.
6) Not use any commands from the following 'prohibited' list: CLS, GOTO, GOSUB, LOOP MUSIC, LOOP SOUND.
The following is a link to a ZIP file containing my solution to my own challenge. The source code is not included (I can't give away the answers!) but you can run the executable and see an example of the expected outcome.
http://www.ausleague.com/files/DBPChallenge/Bees.zip
Once a few people have attempted (and hopefully nailed!) the challenge, I will post the source code I used to create this executable so you can see how I did it each step of the way. I'm looking forward to the day when somebody finds a better way to do it than I did!
*** BROWNIE POINTS: Awarded if the program makes use of a User Data Type for an array containing the bee locations.
*** BROWNIE POINTS: Awarded if the program adds a second image somewhere on the screen that the bees can hide
behind, while remaining in front of the background image.
*** BROWNIE POINTS: Awarded to anyone who can identify the song I've used as my background music in my example solution!