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
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 7th Nov 2008 17:08
Thanks Steve.


I decided to get rid of my joke section though.


I download memory.
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 7th Nov 2008 18:21 Edited at: 7th Nov 2008 19:47
If you could figure out the code, you could probably have it connect to some web page and find a joke of the day or something.

[EDIT]
Rats...it looks like I won't be able to enter this one after all. Its already been a week and I haven't had time to do anything on it.

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 7th Nov 2008 21:07 Edited at: 7th Nov 2008 22:33
Thanks very much NanoGamez Guy

My brain was spinning yesterday, but I think I get it now.

In case anyone else was struggling with this. Here's working code if anyone wants to use it (most of the credit goes to Nano!)

I think its relevant to post here in case anyone else wanted a clock on their menu/toolbar mini-game thing (otherwise I would have posted it in snippets):

NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 8th Nov 2008 11:02 Edited at: 8th Nov 2008 11:06
@BN2
You've still got 6 days until Friday...

@Steve
Looks good, looking forward to seeing your entry.


"To succeed is not enough, others must fail" - Gore Vidal
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 8th Nov 2008 22:36
@ Nano
Thanks Have you come up with anything for this? I will reveal that my entry has a fish in it and you use the mouse.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 10th Nov 2008 00:31
Quote: "Noooooo!!!!! All me copying and pasting is for nothing."

You wont waste that time again though will you.
"You put your new code in"
"You put your old code out"
"in out, in, out, cut and paste it all about"
"delete it all by accident and start again"
"that's what its all about!"

A small program that works is better than a large one that doesn't.

DBC Challenge Rank: Rookie
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 10th Nov 2008 03:27
Argh no Obese! Bad memories!


I download memory.
NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 11th Nov 2008 22:49
So how's everybody's entries going?


"To succeed is not enough, others must fail" - Gore Vidal
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 12th Nov 2008 04:59 Edited at: 12th Nov 2008 05:00
So far I have only managed to get the menu and 1 mini-game working. Work and other obligations has restricted the amount of time I could spend on this. Working 12 hours a day doesn't leave much time for coding

Hopefully I can get at least one other mini-game working before the deadline. How about everyone else?
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 12th Nov 2008 05:02
I have multiple new features. I think I'm going to stick with one game. It's looking pretty good. The one game needs more levels. I'll unveil my program soon.


I download memory.
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 12th Nov 2008 07:08 Edited at: 12th Nov 2008 07:16
@Irojo

I like the stretching interface in yours - very cool. Nice idea with the moving block/fading thing too.

Only odd thing I noticed was the text on the buttons changed size from small to big and then stayed big. Looks like you didn't set the initial size. Then you did set a size for some different text, but didn't reset it for the buttons.

Guessing you've probably fixed that though...Will be cool to see what game you've created
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 12th Nov 2008 15:20
Quote: "I like the stretching interface in yours "

Thanks
Quote: "Guessing you've probably fixed that "

Yep. Thanks for pointing it out though.

Quote: "Will be cool to see what game you've created "





I download memory.
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 12th Nov 2008 22:20
@Irojo

Thats OK I've only been here since Tuesday last week and already have a positive impression of the community, so glad to give feedback.

The board has been a bit quiet lately. I guess people must be finalising their entries. Mine isn't quite finished. Hope to have it completed and online tomorrow though.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 12th Nov 2008 23:46
I just started on a toolbar function. Doesn't do anything yet but has potential!

Enjoy your day.
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 13th Nov 2008 00:01
@Latch

Should be good Looking forward to seeing what you come up with. Your previous entries have been very impressive.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th Nov 2008 00:41
Thank you! I don't know if you've gone through the whole challenge thread but there are a bunch of people that have made some really great stuff! The creator of this thread TDK_Man always had quality entries but seems to have vanished as of late. I have to mention Phaelax who always pulls something impressive out the hat and has been on these forums for 1000's of years. The list goes on and on - some are one timers, some have multiple entries. It would be great if all the past participants decided to join in again... It's probably because of time limitations, people moving on to DBPro or other platforms, jobs, real life responsibilities etc.

Enjoy your day.
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Nov 2008 00:44 Edited at: 13th Nov 2008 00:44
So I have no Internet right now and typically browse the forum on my iPhone, so I just heard about this challenge today. I heard someone mention a clock widget so I made one.

Click the mouse somewhere in the clock to add a neat 3D gradient effect to the clock's face. The hour hand shows the slight offset from the current minutes rather than jump strictly from one hour to the next.




This is more of a code snippet than an entry. Here's a screenshot.



Attachments

Login to view attachments
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 13th Nov 2008 01:55 Edited at: 13th Nov 2008 02:06
@ Latch

I viewed a lot of the entries to past challenges from looking over Phaelax's handy site. I could do with reading over the entire thread, perhaps once I've finished my entry.

Phaelax's Stickman entry for the Target Shooting Challenge was cool. Its fun to shoot and see the explosion of sticks!

@Phaelax

Great looking clock, although it seems to glitch - perhaps you need to GET IMAGE and use a sprite? Or is it just me that is seeing a weird flashing?

Quote: "The hour hand shows the slight offset from the current minutes rather than jump strictly from one hour to the next."

Your way of doing that is tons better than my crude if statements. Thanks for posting it
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th Nov 2008 02:06
@Phaelax

I put a flag variable to draw the number part of the clock only once. That cures the flashing. Also got rid of the CLS in the main loop - though that messes up the info display in the upper left:



Enjoy your day.
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 13th Nov 2008 02:35
I managed to insanely push up the FPS. I got 700-900 before the text ran off screen. Still, It slows my own program too much. I'm pretty happy with it. I did get rid of the circle that follows the mouse. The glow thing. It took like 100 FPS.


Quote: "already have a positive impression of the community"




It's almost time for me to unveil my program!


I download memory.
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 13th Nov 2008 03:14
@Irojo

Flawless clock code

Quote: "It's almost time for me to unveil my program!"

Wow! You're almost finished?!...I'd better stop hanging around here and get on with mine... (runs off)
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 13th Nov 2008 06:07
Quote: "Flawless clock code "

I like you.

Quote: "Wow! You're almost finished?!..."

As far as I'll ever be.

I figure I'll put out my code for my calculator, even though it's not going to be done in time, and the calculations don't work.

Maybe It will help someone.




I download memory.
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Nov 2008 09:17
the ring around the clock caused an odd flashing on my PC also, I was hoping it was only my computer.
I can't seem to figure out what's causing it


Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 13th Nov 2008 15:09
You had too much being drawn, without enough syncing.


I download memory.
NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 13th Nov 2008 17:45
Only one day left, you need to start finishing and posting your entries.

@Phaelax
Your clock looks good, cool gradient effect. The flashing can be fixed by drawing everything to bitmap 1 and then coping it to bitmap 0, although it's still pretty slow. (I don't remember who first suggested drawing to bitmap 1, but I remember it was something to do with different types of memory)

@Irojo
Do you think you could finish your calculator if the deadline was extended? There was a challenge a while back to make a calculator, perhaps you could take some inspiration from that?

@All
Would it be a good idea to put the deadline forward a couple of days?


"To succeed is not enough, others must fail" - Gore Vidal
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 13th Nov 2008 17:51 Edited at: 13th Nov 2008 18:55
Quote: "Do you think you could finish your calculator if the deadline was extended?"

No, and I do not think extending the deadline is a good idea. That seems to result in thread problems, with judging not occuring, and people not entering, etc.

I will post my program very soon.

[EDIT]
Here it is!!!




A few features I'd like to point out:

The Game's Gravity. When you jump, the power starts pretty high, then decreases, until you reach the top of your jump. Then you fall back down, at a slowly increasing speed.

--
The art program was not made for this program, and it is indeed complicated to use, and not simple.
--
"Screen" Is a toggle the switches from window on to off.
Perhaps I should have made it different.
--
In the Ninja game, to skip through the beginning press the up arrow key. If you want to speed up the text, press space.

Enjoy!


I download memory.
NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 13th Nov 2008 21:38
@Irojo
Looks really good! You've obviously worked very hard on it. I will give it a full review when I mark all the entries at the end of the challenge. One small thing though, when you set text font, could you add a ',1' at the end, like this:

Because I've got DB 1.2, and if you don't do that the text gets messed up.


"To succeed is not enough, others must fail" - Gore Vidal
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 13th Nov 2008 21:42 Edited at: 13th Nov 2008 21:43
Cool little Ninja game, graphics and gameplay remind me of the Atari 2600 games of the 80s. Certainly has a unique jumping style. Well done

I got a bit confused with the Art/Paint section. I read the instructions, but struggled to find my way around. Probably could have done with some more onscreen prompts and info (just a suggestion for your future projects). I also got stuck and couldn't return to the Menu without restarting the program. However, a good attempt at a paint program though

Neat binary converter. Use is lost on me though, probably has more appeal to advanced users as I have no idea what I would use binary representation for (yep, I'm still a noob ). Groovy gradient effect on the background.

My fish game has not that far to go before I consider it worth entering. I was thinking about posting a preview...hmmm...
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 13th Nov 2008 22:02 Edited at: 13th Nov 2008 22:05
@Nano

Ya... mines not the new version. I'm trying to figure out what to do, if I want to send all the info to TGC so I can upgrade, or if I'll switch on to C++ since I now have a basic knowledge of programming.

Not that I don't love this forum.

@steve paul thomas

Yep, the binary is useless
Thanks for the comments on the game!
For the art, you need to put your mouse all the way on the right of the screen, then press y, then press tab. Easy to remember isn't it!

I didn't want to spend the time to make the menu. Sorry.


I download memory.
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 13th Nov 2008 22:44 Edited at: 13th Nov 2008 22:52
@Irojo

Quote: "Yep, the binary is useless"


Perhaps someone here does know a use for it in DB programs. Neither of us do, that much is certain! lol

Some people were discussing it here:

http://forum.thegamecreators.com/?m=forum_view&t=115140&b=10

Quote: "Thanks for the comments on the game!"


That's OK


Doesn't this do what you need?

DB Classic Upgrade

Also, its OK that there is no menu for the Paint program.
Might be more user friendly to have some text at the bottom to remind you of shortcuts?

e.g. R = Adjust R, G = Adjust G, etc

Or perhaps a button you can click or press F1 to bring up a list of shortcuts? Just a suggestion



Quote: "For the art, you need to put your mouse all the way on the right of the screen, then press y, then press tab. Easy to remember isn't it!"


Aha! So thats how you quit to menu!
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 13th Nov 2008 23:07 Edited at: 13th Nov 2008 23:09
Quote: "Doesn't this do what you need?"


Hmmm... It seems to, however, I tryed downloading it, and it seemed to have redownloaded DB. It came up as 1.14

Quote: "So thats how you quit to menu! "

Then you need to enter the 13 digit PIN,

I might try the F1 idea.


I download memory.
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 13th Nov 2008 23:17 Edited at: 13th Nov 2008 23:37
@NanoGamez Guy

IMO I think we should try to make the most of the last day and submit our entries as they stand on that day.


@Irojo


Quote: "Then you need to enter the 13 digit PIN"

...and you only have 30 seconds before the program explodes lol


Quote: "Hmmm... It seems to, however, I tryed downloading it, and it seemed to have redownloaded DB. It came up as 1.14"


Yeah, I think Lee might have been in a hurry and forgot what version was what. My editor also says 1.14. You'll also notice that the text command now renders differently to what it did before. Try it out.


I found a bug in your binary calculator. If the user types in more than a string type can hold then the program crashes. Add the following after input msg$ :



I think that fixes the problem

Here is a preview of my entry (I want to try and get some more done before I submit it as finished though). Be sure to have an up-to-date DBC or the text will look too small:



Thats about 1000 lines.
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 14th Nov 2008 00:03 Edited at: 14th Nov 2008 00:30
About your entry. I'm sorry, but I have alot of problems with it.
To name a few:

-The Mouse
-The Clock
-The Fish
===
They all have a potential to take my victory.


Only one problem I encountered was the fish went into the sand.

The update worked thanks much.

MUCH.

So you could potentially be harmful to this community- You might take my victories.

Impressive coding!

And something that might save you some time: Wait key.

I used to suspend for key too.


[EDIT]

My program has died! The text flashes and shows small text size and the new text size, if you press the screen button. This is horrible...

Save it...
Please...
Someone....
*Sobs*




I download memory.
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 14th Nov 2008 00:42
Quote: "About your entry. I'm sorry, but I have alot of problems with it. To name a few:

-The Mouse
-The Clock
-The Fish
===
They all have a potential to take my victory."


I didn't think mine was that good...thanks very much!



Quote: "Only one problem I encountered was the fish went into the sand."


Thanks for pointing that one out. I did try to use a gradient on the sand earlier and make it look like it faded into the distance (to add some perspective to it) that will be why the fish appears to go into the sand. Should probably change that back so he avoids the sand.

Also have to:

> Make the "New Fish" button reset the game.

> Make the fish actually die when health is zero - at the moment he swims around quite happily, the crazy little zombie lol

> Put an Exit button so you can click to exit.

> Add some scenery to make it look less plain.



Quote: "So you could potentially be harmful to this community- You might take my victories."


I wouldn't worry just yet! Your entry does a lot more stuff than mine does , also the others still have to post their entries.



Quote: "Impressive coding!"

Thanks again, its the first working game-thing I have made in DB.


I'll switch to Wait key!
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 14th Nov 2008 01:22 Edited at: 14th Nov 2008 01:50
Quote: "My program has died! The text flashes and shows small text size and the new text size, if you press the screen button. This is horrible...

Save it...
Please...
Someone....
*Sobs*"



I try to avoid rendering text directly to the screen as that seems to be a bit buggy - sometimes it works, then sometimes it puts on a headache inducing light-show (FLASH * too many!)

Anyway...here's some fixes...

Just fixed the menu by remarking out "set text opaque":



Also under your "games" label add sync after the text command:



Hope that helps You might have to do some text size fixes here and there. Also, anytime you render text directly to the screen you should use sync or it will try to render the old size and the new size.

As you can see from my Feed The Fish, I prefer to:

Create a bitmap offscreen (this also sets the current bitmap to 1)




1) Then when I want to draw something:




2) Print, use text or draw to offscreen


3) Grab an image of it:



4) Return drawing to the screen:



5) Display using a sprite



Not saying that is the best way, but it seems to work OK for me.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th Nov 2008 01:53 Edited at: 14th Nov 2008 01:55
@steve paul thomas

Nice! You've programmed with something before DBC I imagine. If not, amazimg! One thing I might suggest: Where you have large lists of values being assigned to arrays; while it's fine to assign them one at a time by typing each array name followed by an equals, it can sometimes be more practical to store the values in DATA statements and read them into the array with a loop.

For example:



Could be:



With such a short list, this approach may not be necessary, but let's say there were 50 items, or 100 items, then it becomes a little easier to input, and easier to debug (with less chance of typing errors).

Also, you seem to indent only at the first level of a code block. You might have something like



when clearer indentation might read like:



So a general rule of thumb is to indent what's in between every code block: do loop, for next, repeat until, if else, else endif, if endif, while endwhile, open close file, label return, select endselect, case endcase, remstart remend

Enjoy your day.
Ashingda 27
17
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 14th Nov 2008 02:02 Edited at: 14th Nov 2008 02:03
You can work ofscreen entirely.

First create your bitmap, something like this.
Quote: "create bitmap 1,640,480"


Then right befor you sync, copy it over to the screen.
Quote: "copy bitmap 1,0
sync"


Grabing an image might slow you down a little bit.
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 14th Nov 2008 02:11
@Latch

Quote: "
Nice! You've programmed with something before DBC I imagine. If not, amazing!"


Yep, also code in Javascript and PHP (though I'm not a professional programmer, I just do a bit as a hobby). I used to know Delphi (Object Pascal) many years ago, but that has since almost faded to black.

Have made some silly little games in Javascript, but DBC is the first time I've made a full-screen game with timers and a random A.I.


Quote: "With such a short list, this approach may not be necessary, but let's say there were 50 items, or 100 items, then it becomes a little easier to input, and easier to debug (with less chance of typing errors)."


I skipped over "DATA" when I started learning DBC as I thought it was the old-way of storing data, with arrays being the modern way. I can now see the use of data statements, I think I'll have to practice with them.


Good point about the indentation Your way is much clearer to read.
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 14th Nov 2008 02:16 Edited at: 14th Nov 2008 02:21
@Ashingda 27

GET IMAGE seems to be OK for this program. Also I used it where I don't want to grab the entire screen. However, your point is good and I would use COPY BITMAP for copying the whole screen.
Ashingda 27
17
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 14th Nov 2008 18:40 Edited at: 14th Nov 2008 18:43
BAhh! I dont think I'll ever finnish this. Well here's my entry.

I really does nothing as of now .

Well I got the time working...

steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 14th Nov 2008 19:27
@Ashingda 27

Quote: "BAhh! I dont think I'll ever finnish this. Well here's my entry.

I really does nothing as of now .

Well I got the time working..."


Very fancy looking though


OK, I don't have time to add anymore to my entry so I'll just post the final code now...

Attachments

Login to view attachments
Ashingda 27
17
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 14th Nov 2008 19:33 Edited at: 14th Nov 2008 19:33
You know it was actually quite easy to feed the fish even on Hard, just have to click on or near it. Mayabe you can make the fish get fat if you feed it too much, going over the 100% health.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 14th Nov 2008 20:14
I totally forgot about this challenge!

@Ashingda
It looks good but may I suggest a few slight changes in your structure, please correct me if there is good reason for doing it your way I only had a glance at your code...

To draw your icons you use two functions: one to draw the outline of the button and the other draws the image depending on an ID value that is passed.
I'd suggest making a subroutine that draws all the icons and grabs them as images, then have a function for drawing icons that is passed the image number it requires, maybe even save the whole icon as a single image. This way you don't have to keep redrawing the icons (db graphic commands are much slower than image pasting).
Your menubox doesn't quite fit the bill for making Icons, you had to blank out the string that is passed. Don't avoid making new functions for specific tasks, if a function doesn't fit a task it is either totally unsuitable or too high level. In this case I think it would be better to write a new specific function than try and break down the menubox function into functions that can be used by both menuboxes and icons.

You seem to think you have to set the ink colour every time you draw something, you don't, ink will stay the same colour until you change it. I like your use of the c1 and c2 variables to store different colours but since they are constant you only need to declare them once, before the if statements that check ID, for greater flexibility dimension an array to store your colours.

Your State flag isn't needed, as far as I can see the first two states are only performed once so can be placed before the main loop. Flags are required when you want to regulate the number of times a process is executed: so if your OS needed to reinitialise, a flag would be handy as it would let you run the first two states again and they'd lie dormant once more until needed.

Your lbox function took a while for me to realise what it does, but it is very familiar, I think most programmers must have written a function very similar to that at some point
giving it a more descriptive name would help like "linebox" or "frame" don't be concerned about long names it will make it easier to follow. One thing I would point out about the function is its parameters; I'd only use a length and width if I was drawing something that was centralised on a point (x,y), for a box I'd give the co-ordinates of the right and bottom extremes instead as this means you don't need to do calculations and can pass the values to other things like collision detection without calculation.

My philosophy for where to put calculations and what not is "one and infinity are the same" sounds a bit strange but what I mean is to treat anything you ask your computer to do once a loop as if you were asking it to do it infinity times. This way of thinking makes a small workload you wouldn't normally consider seem huge.
I know that with today's computers you don't have to be so frugal but it's good practice none the less.

Sorry about putting you under the microscope, I do that to most people I think have potential

A small program that works is better than a large one that doesn't.

DBC Challenge Rank: Rookie
Ashingda 27
17
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 14th Nov 2008 21:05
Hehe Thanks Obese, note taken.
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 14th Nov 2008 21:07 Edited at: 14th Nov 2008 21:19
Quote: "You know it was actually quite easy to feed the fish even on Hard, just have to click on or near it. Mayabe you can make the fish get fat if you feed it too much, going over the 100% health."


Yeah it is a bit simple and I did want to change this, but don't feel like adding more to it tonight (too tired to code), since the deadline is midnight I figured I would just post what I have done.

Here's what I would have added though (taken from the top of the source):

Areas for Improvement:

If I could dedicate more time to this I would have added:

Fish to swim away from mouse pointer if you get too close to it
(as the game is at the moment, its kind of easy to just click on
the fish)

Scenery - wobbly seaweed (using sines?) and other cool stuff found
in fish tanks

Maybe add some useful tools or stuff related to the fish tank.

If anyone wants to improve on this or even make some derivative of
it, I'd love to see it


@Ashingda 27

Great idea about if you overfeed the fish Maybe I might revisit this in the future, or perhaps it will inspire someone. I'm just happy to have joined the DBC community and entered the chanllenge.


@Irojo

Quote: "My program has died! The text flashes and shows small text size and the new text size, if you press the screen button. This is horrible...

Save it...
Please...
Someone....
*Sobs*"


I hope you managed to fix your program. There's a couple of fixes further up the page. Your Ninja game was a great idea.
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 14th Nov 2008 21:29
Thanks Steve. It runs perfectly well now. NOBODY PRESS THE SCREEN BUTTON!!! I really love your clock.

NICE CODE ASHINGDA.
That was cool.



I download memory.
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 15th Nov 2008 00:31 Edited at: 15th Nov 2008 00:42
Quote: "I really love your clock"


If you mean the one in my project, I couldn't have got
a clean version of the code without the help Nano.
You and anyone else is welcome to use the code in
your own projects.


Your project still seems to flicker when I run it. Are you sure you posted the right version of your code? I couldn't resist messing about with it...

At the very top of your program I noticed you have the text set to opaque, DB seems to try to render both the black background of the text and the grey button behind it. Found a quick fix is to remark out the set text opaque (or just remove it).

This also seems to fix using the Screen button




Also under your Tools: label you declare some new settings for the text command. However, if you draw directly to the screen you must use sync after writing the new text or it will flicker with the old settings and the new settings:




Under Binary:



Btw When using print command and you want to insert a blank line, no need to use:



You can just use:



Try it out!

Not trying to tell you what to do or anything like that. Just thought I would make some suggestions
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 15th Nov 2008 01:04
THANK YOU.

I was wondering why it flickered. Odd... it didn't used to do that. Mmk. Thanks a bundle mate.


I download memory.
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 15th Nov 2008 01:12
@Irojo

No problem. Happy to have helped


@BN2 Productions

Weren't you going to enter this? I was hoping to see what cool stuff everyone else was going to come up with.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Nov 2008 01:14 Edited at: 15th Nov 2008 01:18
Lot's of great stuff there everybody!

I don't know if I understood this challenge entirely but here's an entry. The focus is on the toolbar function. I made it very versitile so it could be sized, repositioned horizontally or vertically, tools could be active or inactive, the number of available buttons could be from 1 to 10 with any of them intermittently active or inactive. Because the size of each button and the whole tool bar is determined by x1,y1,x2,y2, by changing these you not only uniformly resize the buttons and the toolbar but it allows for easy drag code to be implemented:


I took advantage of DBC's function variables being static. This allows the toolbar to behave as a series of toggle switches. Only one tool can be selected at a time and it remains active until clicked off.

The following is just a quick demo of the toolbar. Every 2 secs it will switch from horizontal to vertical with the single switch of the parameter direction. I've set the number of tools on the toolbar to 10 (that's all of em) and turned off a few of them. If you click on any it will return the number of the tool (0-9). I added 1 to the return value just so the button matches the count.
The inactive buttons are just spaces. This can allow you to group tools together with missing buttons as separators (or as an area to click and drag on). Right now it's hardcoded to 10 controls but that is easily changed.



Now for my entry:
I only started working on this last night and didn't get very far. It demos the toolbar. The first 5 buttons are active. I didn't disable the rest of the buttons because I had planned on having more functions. The main menu (if you can call it that) describes the mode that each tool invokes. You can return to the main menu by toggling the mode off or you can directly jump to another mode by clicking another button.

The toolbar will jump around and change size and shape as you click on different modes. This is just to show that the bar is easily adjustable. You can move it out of the way and or shrink it down in a particular mode but leave it visible and active. You could even turn off active buttons or change the number of buttons that are available when you witch a mode. Also, holding RIGHT CLICK on the mouse, you can drag the toolbar around - ONLY ON THE MAIN MENU though... I put it in as an after thought and I would have had to add an extra gosub to the different modes... no biggie

There are no icons for the buttons. I was planning on creating a partner function that would take image numbers as input and no matter what size the image is, it would be sized according to the current tool bar/button size(s).

Anyway, here is the entry. No games, but just a bunch of demos (and a clock)



Enjoy your day.

Login to post a reply

Server time is: 2025-05-18 19:30:00
Your offset time is: 2025-05-18 19:30:00