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 / Agent's 2nd Padawan Challenge: An educational tool for newcomers

Author
Message
Agent
19
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 20th Jun 2011 08:54
Hello padawans! Some time ago I posted the Educational Challenge for newcomers involving moving objects around on the screen with the mouse, background images, music and sound, in which a number of new DBPro padawan learners (and even quite a few experienced Jedi) competed for the title of Most Awesome Newcomer! This challenge has since ended with many people commenting that it was a useful learning tool and there were several requests for a sequel.

The original challenge, if you missed it, can be found here: http://forum.thegamecreators.com/?m=forum_view&t=184136&b=7

I think it is well past time that I issued a second Padawan's Challenge!

This time around we're going to take a step back and work on a specific target area for newcomer development. I think it is no easier and no harder than the original challenge but there should be something here for all newcomers who are still working towards building their first real project.

This challenge will test padawan's ability to draw objects to the screen, read information from the mouse, and to respond according to the interaction between the mouse and the onscreen objects. We'll be working in just two dimensions this time, but don't let that fool you; we'll be looking at such concepts as conditional selection, moving objects and collision detection.

Here comes the challenge: The finish project will:

1) Draw a simple "menu" on the screen, featuring five differently colored rectangles drawn vertically in the center of the screen in which some text will be drawn ("Option 1", "Option 2", etc).

2) On mouse leftclick, detect which of the five options has been selected.

3) If one of the first three menu items has been selected, play a sound effect and disable that option from being selected again by removing the menu item from the screen.

3) There must be no sound effect played if the mouse is clicked in an area that used to contain a menu item that has been removed.

4) If the user selects the fourth option, all menu items should be reactivated and become available for selection once again.

5) If the user tries to select the fifth option, that menu option will run away! As soon as the mouse touches it, it should teleport somewhere else on the screen, at random. Each time the user tries to get it, it will take off and hide somewhere else on the screen.

6) This runaway fifth menu option must never touch another menu option. When deciding where it will randomly move to, the program must check to see if it will overlap another menu option. If so, it will find somewhere else to go.

7) Only one external file is allowed in this project: One sound effect that is to played when the user selects one of the first four options.

8) No plugins are allowed to be used to circumvent any otherwise difficult part of the challenge. Only core DBPro commands are valid.

9) As ever, no commands from the prohibited command list are allowed. In this challenge, the prohibited list is small: CLS, GOTO, GOSUB.

10) BONUS POINTS: Awarded if the user can alternatively select menu items by pressing number keys on the keyboard. Another bonus point if you show me something impressive (padawan's creative choice!) if the user catches the runaway fifth menu item by using the keyboard to select it!

Let's see how you all do with this one! Go, my padawans, and may the source be with you!

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Jun 2011 14:50
Nice second challenge Agent! Very useful to be able to make a simple menu.

May the source be with you all

Kezzla
15
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 22nd Jun 2011 13:47
cool challenge! These new menu skills will go in the kit bag. cheers man.
my entry is attatched to this post.
kezzla

Sometimes I like to use words out of contents

Attachments

Login to view attachments
Agent
19
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 23rd Jun 2011 06:27
Nice submission Kezzla! Your fifth menu option made me chuckle

Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 29th Jun 2011 00:54
Took me a little bit of time to work out why the number 5 box wouldn't move, turns out I had my top and bottom backwards in code...doh!

Here is my submission

Attachments

Login to view attachments
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 1st Jul 2011 00:22
Nice challenge, lots of training from this one. Good way to strengthen your source.

Agent
19
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 7th Jul 2011 11:12
Hey guys, has anybody else made an attempt at this challenge? Once there have been a couple of entries I'll start ranking them as I did last time!

T4r4ntul4
14
Years of Service
User Offline
Joined: 1st Jan 2010
Location: close to my pc
Posted: 7th Jul 2011 12:52
well, i want to, but when is the deadline? i need a menu system for my new game, so this is a perfect challenge for me now
Agent
19
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 7th Jul 2011 21:42
There's no deadline You can enter this challenge any time you like, even after it's "closed", when we release our source code to show how it's done. It's not truly a competition, it's just a challenge to undertake to learn how to do key things in the game making process. This one will teach you how to display objects on a screen, detect when something has been clicked, and move things around while still keeping track of where they are. These skills are for more than just making a menu work; that's just the context into which I've put these essential learning skills.

After there have been a few entries I will 'grade' them according to the requirements I set, and after a while I'll call for a source code release so everyone can compare their techniques.

Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 1st Aug 2011 01:01
What's the word on releasing our source code? Still too soon?
Agent
19
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 6th Aug 2011 02:29
Well I guess there hasn't been all that much interest this time around. Go ahead and post your code as well as any new submissions and we'll see what we can see!

Kezzla
15
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 6th Aug 2011 05:02 Edited at: 6th Aug 2011 05:06
yeah, shame about the lack of entries.

It would still be good to continue the challenges and eventually add them all together into a progressive challenge course for noobs locked at the top of the forum.

anyway, here's my entry source.


I know a lot of the functions really should have been done with subroutines, but I was just getting into playing with functions and wanted to use them.

edit: oh yeah, no subroutines allowed, that's why no subroutines. lol, its been so long since I made it, I looked at it again and wondered why I didn't sub it as there was no return data. /edit

I'd also like to say that the skills i've learned taking on these challenges have found their way into my other projects.
very handy stuff.

thanks again man

kezzla

Sometimes I like to use words out of contents
Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 7th Aug 2011 04:37
I agree with Kezzla, both have been great for learning the language used in Dbpro!! Can't wait for the next

Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 14th Aug 2011 09:04 Edited at: 14th Aug 2011 09:04
Just thought I'd share a few things off the top of my head.

- Calling subroutines are much faster than calling functions.
- Calling variables are much faster than calling arrays.
- Performing Boolean checks are much faster than actually performing a process like paste sprite.
- Type casting integer into float is very slow. a = b/1.0
- Loading many smaller images are slower than loading a single larger image.
- For/next loop takes up process, doing too many smaller ones inside a large loop slows down alot.


Kezzla
15
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 14th Aug 2011 12:14
good stuff

c'mon agent, don't let the recent lack of entries put you off, you have good understanding of the newb mindset and the tasks that can set it free.

make your newcomer course, its a good idea, just stick with it.

kezzla

Sometimes I like to use words out of contents
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 14th Aug 2011 19:02 Edited at: 14th Aug 2011 19:39
Been a long time since I've been around these parts... this looked like a fun way to get the DarkBasic dust off. I'm not sure if I was more amazed how much I had remembered or how much I had "Forgotten". LOL. This is by no means a lean or pretty solution,, hahah,, but it was fun to see if I could even do it.

****NOTE*** I still have to complete Item(s) 3 (yeah there are 2 of them in the list). I have no sound attached, nor checks to not play sound. I will see if I have time today to add that.

Will be interesting to see other's solutions. I went with a sprite based solution. Was tough to stick to the rules.



*** I'll add a version with the sound req's and the bonuses later. Think it's nice to include a (No Media Req'd Version).

##!fixed option#5 collision detection bug

Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 3rd Sep 2011 20:24
Ready for the new one
What's it gonna be, what's it gonna be????????

Login to post a reply

Server time is: 2024-04-26 23:22:03
Your offset time is: 2024-04-26 23:22:03