The Game Creators
The Game Creators Home Online Shop Click to Login
  Hot: Christmas CompetitionNovember NewsletterModel Pack 36DB Pro Pack 2009DGS BonanzaCharacter PackFPS Creator Bonanza;
The Game Creators
DarkBASIC / The DB Classic Programming Challenge Thread

Go to the first page of this board Return to the Forum Menu Post Message
3,384 Messages - Page   of 85   
Bookmark and Share Search the Forum Next 40

Author Message
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 11th Jan 2007 15:04     Edited: 5th Dec 2008 13:13     | link | toggle

The DB Classic Challenge Thread


[Edit: 10 Dec 08 - DBCC website is fully up to date. Challenges set from October 12, 2007 to current now include details about the challenge.

http://zimnox.com/dbcc/?page=challenges

[Edit: 10 June 07 - New Rule 12 Added]

Here are the rules for the DBC challenges. It's pointless re-inventing the wheel, so I've borrowed heavily from the DBPro Challenge rules and modified them for DBC - I hope they don't mind. (Obviously, all credit to Ric and those involved in originally creating them).

Please read all of them before starting your entry.

1. Anybody may enter any challenge, as many times as they like, so long as all code will run in DB Classic with NO alterations. You can still enter the challenge - even if you use DBPro as long as you follow this rule.

2. No external media is allowed - that includes models and external graphics. In other words, the challenge entry must be a single DBA code listing that others can simply copy and paste into DBC and run it. Any media your program uses must be generated by the code itself.

3. All challenge entries are to be written in the standard un-enhanced version of DBC. You can actually use any version of DBC, but for the benefit of those who do not have the Enhancement Pack, you may NOT use any of the additional commands if you have them.*

4. The person who wins the current challenge becomes the next challenge setter.

5. The challenge setter is the judge for the current challenge, and must select a winner and a runner up.

6. The challenge setter may enter, but cannot judge him/herself the winner.

7. The challenge setter will set the time limit according to difficulty. The challenge setter may extend the deadline by 24 hours if there is a very good reason, but extensions cannot be made during the final 24 hours of the challenge.

8. If nobody enters within the time limit, the challenge setter must set a new challenge.

9. If the challenge setter fails to judge entries or set a new challenge within 24 hours of the deadline, responsibility for judging and setting a new challenge will pass to the previous runner up. If that person also fails to act promptly, entrants may vote for a winner and new challenge.

10. You may use code from any other entries within the challenges thread for your current entry, so long as you improve upon it in some way and give credit.

11a. Deadlines are always midnight GMT on the day specified. If GMT is not mentioned it should be assumed. This does not disadvantage entries from other time zones in any way as they still have the same number of hours to complete the challenge as everyone else, as they start earlier (local time).

11b. At the end of each challenge, the challenge setter should post and declare the current challenge over within 6 hours of the declared deadline. Entries can be submitted before this 'closing' post without penalty.

11c. If the challenge setter does not close the challenge for any reason, it automatically closes 6 hours after the deadline - after which no more entries can be accepted.

12. Changing a challenge. If no-one enters a challenge - for example if it is deemed too difficult - anyone can post and suggest that the challenge be changed (or modified), along with their reasons for doing so. If no-one has actually started work on the challenge and the majority agree, then the challenge setter can simply alter it or set another one and announce the new deadline.

In the case of a challenge being completely abandoned rather than modified, anyone who has already started work on the challenge and has done more work on it than they would like to abandon, they can lodge an objection.


* It is possible to ignore this rule (3) if the challenge setter has enough support from the contestants to use the enhanced commands and the use of such commands is clearly stated in the challenge description. For example, a very worthwhile challenge may be set using memblocks - something impossible to do if you can't use the enhanced commands.


OK, so that out of the way, on to the very first ever DBC programming challenge...

To be honest, this challenge was also used in the DBPro challenge thread and I had an entry myself - though I didn't win it!

But I enjoyed writing it and it's such an easy challenge, I'm sure everyone will be able to enter - whatever experience level you are currently at. So the challenge is:


**********************************************************
**********************************************************
NEW CHALLENGE
**********************************************************
**********************************************************


The DBC Clock Challenge...

Your task is quite simply to write a program which displays the current time in an unusual way. That's it! Exactly how you do it is all down to your imagination and ingenuity. It can be in 2D or 3D and doesn't even have to look like a normal clock - as long as you can easily read the time using it.

The challenge will be judged on ingenuity and extra points earned for imaginitive entries.

I'll set the period for the challenge at one week - ending at midnight (GMT) on Thursday 18th of January 2007.

Please feel free to comment if you think this should be extended.

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Lucifer

User


Joined: Mon Dec 26th 2005
Location: Iceland
Posted: 11th Jan 2007 17:16           | link | toggle

yay! i might enter this challenge but i dont know if i will be able to do something like this


i like pancakes..
Back to top
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 12th Jan 2007 09:46     Edited: 4th Feb 2007 11:16     | link | toggle

Just as an example, here's the compiled exe of the entry I submitted for the DBPro challenge:

http://www.computechtenerife.com/clock.zip (4.4MB)

I couldn't post the source because it won't run in DBC and would require far too many modifications to make it do so.

I will be entering this challenge, but obviously I can't win it. It won't be using this idea though either...

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
DrewG

User


Joined: Thu Aug 25th 2005
Location: Cyberspace
Posted: 12th Jan 2007 10:09           | link | toggle

Hey I may enter as well. Keep us posted please.

please forgive me about my forum name.
Back to top
Report this message as abusive
Rigo

User


Joined: Fri Jun 13th 2003
Location: Hungary
Posted: 12th Jan 2007 10:15           | link | toggle

Nice program, TDK!

FZoli.
Back to top
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 12th Jan 2007 10:38           | link | toggle

Quote: "Hey I may enter as well. Keep us posted please."

Better decide quickly - this challenge has already started!

(Deadline is in one week's time).

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Sven B

User


Joined: Wed Jan 5th 2005
Location: Belgium
Posted: 12th Jan 2007 11:15           | link | toggle

*opens up "Mini IDE"*


It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Back to top
Report this message as abusive
Sven B

User


Joined: Wed Jan 5th 2005
Location: Belgium
Posted: 13th Jan 2007 03:19           | link | toggle

Here's the first entry of the first challenge of the first DBC challenge thread ever!!!

+ Code Snippet
sync on : sync rate 0
hide mouse

`Set text font
set text font "Comic Sans MS"
set text size 10

`Colors
Colors = 7

`Constant color (1 = red, 2 = green, 3 = blue)
dim Color(Colors, 3)
Color(1, 1) = 255 : Color(1, 2) = 255 : Color(1, 3) = 0
Color(2, 1) = 255 : Color(2, 2) = 0 : Color(2, 3) = 0
Color(3, 1) = 0 : Color(3, 2) = 255 : Color(3, 3) = 0
Color(4, 1) = 255 : Color(4, 2) = 0 : Color(4, 3) = 255
Color(5, 1) = 0 : Color(5, 2) = 255 : Color(5, 3) = 255
Color(6, 1) = 0 : Color(6, 2) = 0 : Color(6, 3) = 255
Color(7, 1) = 255 : Color(7, 2) = 255 : Color(7, 3) = 255

for i = 1 to Colors

	`Create media
	for y = 1 to 16
		for x = 1 to 16
	
			`Get the distance to the center
			d# = sqrt( (x-8)^2 + (y-8)^2 )
	
			`Calculate color based on the distance to the center
			if d# < 8.0
				value# = 1.0 / 8.0 * (8.0 - d#)
				ink rgb(Color(i, 1) * value#, Color(i, 2) * value#, Color(i, 3) * value#), 0
	
				`Draw dot (1x1 box is faster)
				box x, y, x + 1, y + 1
			endif
	
		next x
	next y
	get image i, 0, 0, 16, 16, 1
next i


`Create clock image
cls
ink rgb(255, 255, 255), 0
for i = 0 to 60
	x = 320 + (cos(i * 6.0)*175)
	y = 240 + (sin(i * 6.0)*175)
	box x-1, y-1, x+1, y+1
next i
for i = 1 to 12
	x = 312 + (cos(i * 30.0 - 90)*175)
	y = 232 + (sin(i * 30.0 - 90)*175)
	paste image 7, x, y

	`Text
	ink 0, 0
	center text x + 8, y + 4, str$(i)
next i
get image 10, 0, 0, screen width(), screen height(), 1

do

	`Clear the screen
	paste image 10, 0, 0

	`Get time
	time$ = get time$()
	
	`Get hours, minutes and seconds
	hours = val(left$(time$, 2))
	minutes = val(left$(right$(time$, 5), 2))
	seconds = val(right$(time$, 2))

	`Print time and values
	ink rgb(255, 255, 255), 0
	text 0, 0, time$
	text 0, 20, str$(hours) + " - " + str$(minutes) + " - " + str$(seconds)

	`Draw clock

	`Minutes
	for i = 1 to 4
		x = 312 + (cos(wrapvalue(-90 + (6.0*minutes) + (0.1*seconds))) * ((i-1)*25))
		y = 232 + (sin(wrapvalue(-90 + (6.0*minutes) + (0.1*seconds))) * ((i-1)*25))
		paste image 7, x, y, 1
	next i

	`Hours
	for i = 1 to 3
		x = 312 + (cos(wrapvalue(-90 + (30.0*hours) + (0.5*minutes))) * ((i-1)*25))
		y = 232 + (sin(wrapvalue(-90 + (30.0*hours) + (0.5*minutes))) * ((i-1)*25))
		paste image 1, x, y, 1
	next i

	`Seconds
	for i = 1 to 7
		x = 312 + (cos(wrapvalue(-90 + (6.0*seconds))) * ((i-1)*25))
		y = 232 + (sin(wrapvalue(-90 + (6.0*seconds))) * ((i-1)*25))
		paste image i, x, y, 1
	next i

	sync
loop


It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Back to top
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 14th Jan 2007 11:30           | link | toggle

Nice... has a slight 'Christmassy' feel about it!

I do hope we are going to get some more entries. Well guys?

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Sven B

User


Joined: Wed Jan 5th 2005
Location: Belgium
Posted: 14th Jan 2007 13:54           | link | toggle

Yea, I was expecting some more entries as well...

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Back to top
Report this message as abusive
Lukas W

User


Joined: Fri Sep 5th 2003
Location: Norway
Posted: 15th Jan 2007 04:29           | link | toggle

here is my Version 1.

+ Code Snippet
Sync On : Sync Rate 0 : Hide Mouse : Autocam Off

rem Make Clock
Make Object Sphere 1, 100
Scale Object 1, 100, 100, 1
Color Object 1, RGB( 255, 255, 255 )
Position Object 1, 0, 0, 0
ghost object on 1
For x = 1 To 12
   obj = free()
   Make Object Sphere obj, 5
   xpos# = (cos(x * 30.0)*48)
   ypos# = (sin(x * 30.0)*48)
   Position Object obj, xpos#, ypos#, 0
Next x
obj = free()
make object sphere obj, 10
position object obj, 0, 0, 0

rem arms
s_arm = free() : make object box s_arm, 45, 1, 1 : color object s_arm, rgb(255,0,0)
m_arm = free() : make object box m_arm, 40, 1, 1 : color object m_arm, rgb(255,255,0)
h_arm = free() : make object box h_arm, 25, 1, 1 : color object h_arm, rgb(0,0,255)

rem background
obj = free() : make object cylinder obj, 500 : color object obj, rgb( 255, 00, 0 ) : ghost object on obj : set object obj, 0, 0, 0, 1
obj = free() : make object cylinder obj, 560 : color object obj, rgb( 255, 255,0 ) : ghost object on obj : set object obj, 0, 0, 0, 0  : third = obj


rem Camera
Position Camera 0, 0, -100
Point Camera 0, 0, 0

rem Light
set point light 0, 0, 0, 0

Do

   ` get time
   time$ = get Time$()
   hours = val(left$(time$, 2))
   minutes = val(left$(right$(time$, 5), 2))
   seconds = val(right$(time$, 2))

   ` update s_arm
   angle# = wrapvalue( -90+(6.0*seconds)*-1)
   position object s_arm, 0, 0, -1
   `rotate object s_arm, 0, 0, 0
   `yrotate object s_arm, angle#
   `move object s_arm, -23
   `rotate object s_arm, 0, 0, 0
   zRotate Object s_arm, angle#

   ` update m_arm
   angle# = wrapvalue( -90+(6.0*minutes)*-1)
   position object m_arm, 0, 0, -1
   zRotate Object m_arm, angle#

   ` update h_arm
   angle# = wrapvalue( -90+(6.0*hours)*-1)
   position object h_arm, 0, 0, -1
   zRotate Object h_arm, angle#

   ` backdrop
   inc c, 1
   r = sin( c ) * 100
   g = sin( c ) * 155
   b = sin( c ) * 40
   if r > 255 then r =255
   if r < 0 then r =0
   if g > 255 then g =255
   if g < 0 then g =0
   if b > 255 then b =255
   if b < 0 then b =0
   color backdrop rgb( r, g, b )

   ` third background
   inc thi, 1
   scx# = 100-cos( thi ) *40
   scy# = 100-sin( thi ) *20
   scz# = 100-cos( thi ) *80
   Scale object third, scx#, scy#, scz#

   ` camera
   inc cam, 1
   camx# = cos( cam ) * 50
   camy# = sin( cam ) * 50
   camz# = -100+(cos( cam ) * 20)
   position camera camx#, camy#, camz#
   point camera 0, 0, 0

   ` light
   inc light, 1
   lightx# = cos( light )* 50
   lighty# = sin( light )* 50
   lightz# = (sin( light )*-50) - (cos( light )*-25 )
   Position Light 0, lightx#, lighty#, lightz#

Sync : Loop


Function free()
   repeat : inc id, 1 : until object exist(id)=0
EndFunction id


i just can't figure out how to position the arms correctly!

i borrowed + Code Snippet
   ` get time
   time$ = get Time$()
   hours = val(left$(time$, 2))
   minutes = val(left$(right$(time$, 5), 2))
   seconds = val(right$(time$, 2))
from Sven B.
thanks mate, i was struggeling with the timer() command. hahaha i was way off course.


TDK,
if somebody attemt to fix my problem and he/she manages to do so, would my entry still qualify?

Back to top
Send AIM user a message
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 15th Jan 2007 06:54     Edited: 15th Jan 2007 06:55     | link | toggle

Quote: "f somebody attemt to fix my problem and he/she manages to do so, would my entry still qualify?"

See rule 10 in the first post.

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Sven B

User


Joined: Wed Jan 5th 2005
Location: Belgium
Posted: 15th Jan 2007 12:52           | link | toggle

Here you go Lukas W:

+ Code Snippet
Sync On : Sync Rate 0 : Hide Mouse : Autocam Off

rem Make Clock
Make Object Sphere 1, 100
Scale Object 1, 100, 100, 1
Color Object 1, RGB( 255, 255, 255 )
Position Object 1, 0, 0, 0
ghost object on 1
For x = 1 To 12
   obj = free()
   Make Object Sphere obj, 5
   xpos# = (cos(x * 30.0)*48)
   ypos# = (sin(x * 30.0)*48)
   Position Object obj, xpos#, ypos#, 0
Next x
obj = free()
make object sphere obj, 10
position object obj, 0, 0, 0

rem arms
s_arm = free() : make object box s_arm, 45, 1, 1 : color object s_arm, rgb(255,0,0)
m_arm = free() : make object box m_arm, 40, 1, 1 : color object m_arm, rgb(255,255,0)
h_arm = free() : make object box h_arm, 25, 1, 1 : color object h_arm, rgb(0,0,255)

rem background
obj = free() : make object cylinder obj, 500 : color object obj, rgb( 255, 00, 0 ) : ghost object on obj : set object obj, 0, 0, 0, 1
obj = free() : make object cylinder obj, 560 : color object obj, rgb( 255, 255,0 ) : ghost object on obj : set object obj, 0, 0, 0, 0  : third = obj


rem Camera
Position Camera 0, 0, -100
Point Camera 0, 0, 0

rem Light
set point light 0, 0, 0, 0

Do

   ` get time
   time$ = get Time$()
   hours = val(left$(time$, 2))
   minutes = val(left$(right$(time$, 5), 2))
   seconds = val(right$(time$, 2))

   ` update s_arm
   angle# = wrapvalue( -90+(6.0*seconds)*-1)
   position object s_arm, cos(angle# - 180)*22.5, sin(angle# - 180)*22.5, -1
   `rotate object s_arm, 0, 0, 0
   `yrotate object s_arm, angle#
   `move object s_arm, -23
   `rotate object s_arm, 0, 0, 0
   zRotate Object s_arm, angle#

   ` update m_arm
   angle# = wrapvalue( -90+(6.0*minutes)*-1)
   position object m_arm, cos(angle# - 180)*20, sin(angle# - 180)*20, -1
   zRotate Object m_arm, angle#

   ` update h_arm
   angle# = wrapvalue( (6.0*hours)*-1)
   position object h_arm, cos(angle#)*12.5, sin(angle#)*12.5, -1
   zRotate Object h_arm, angle#

   ` backdrop
   inc c, 1
   r = sin( c ) * 100
   g = sin( c ) * 155
   b = sin( c ) * 40
   if r > 255 then r =255
   if r < 0 then r =0
   if g > 255 then g =255
   if g < 0 then g =0
   if b > 255 then b =255
   if b < 0 then b =0
   color backdrop rgb( r, g, b )

   ` third background
   inc thi, 1
   scx# = 100-cos( thi ) *40
   scy# = 100-sin( thi ) *20
   scz# = 100-cos( thi ) *80
   Scale object third, scx#, scy#, scz#

   ` camera
   inc cam, 1
   camx# = cos( cam ) * 50
   camy# = sin( cam ) * 50
   camz# = -100+(cos( cam ) * 20)
   position camera camx#, camy#, camz#
   point camera 0, 0, 0

   ` light
   inc light, 1
   lightx# = cos( light )* 50
   lighty# = sin( light )* 50
   lightz# = (sin( light )*-50) - (cos( light )*-25 )
   Position Light 0, lightx#, lighty#, lightz#

Sync : Loop


Function free()
   repeat : inc id, 1 : until object exist(id)=0
EndFunction id


Though I had to do some tweaking to get the angles right...

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Back to top
Report this message as abusive
Latch

User


Joined: Sun Jul 23rd 2006
Location: Cyberspace
Posted: 17th Jan 2007 16:54           | link | toggle

Any chance we can extend the deadline until Sunday? I haven't had time during the week to work on anything. I did have something I put together last week - but it's not very "clockish" though it does display the time. I just won't have any free time until this weekend.

Enjoy your day.
Back to top
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 18th Jan 2007 07:36           | link | toggle

Quote: "Any chance we can extend the deadline"

Yes - I think that's a good idea too.

The DBC forum doesn't get a lot of traffic, so those that said they would take part in the challenges might not have seen that this one has started.

So, we'll extend this one for another week so the deadline is now midnight (GMT) on Thursday 25th of January 2007.

So everyone please, if you said you were interested in taking part in the challenges earlier in the thread, please do so or the post will just die!

This first challenge is a really easy one so everyone can take part. All you have to do is write a program to display the current time on screen.

It doesn't matter how basic it is, though we are looking for originality in the winning entry. It also doesn't have to be anywhere near the complexity of the exe I posted above - that was just one example of how to write a clock that doesn't look like a clock!

Just write a program to your own abilities. You'll soon find out that in challenge threads, no-one is interested in pointing out how 'noobish' an entry is, but instead will show you how to make it better.

And remember, if you are new to programming and have no idea how to start a challenge, feel free to ask and someone will show you!

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 18th Jan 2007 08:35           | link | toggle

How To Start

As a continuation of my last post, if you are a new programmer and aren't sure where to start with the challenge, here's a snippet which you can build on:

+ Code Snippet
Gosub Setup

Rem *** Main Program Loop ***
Do
  Gosub DecodeTime
  Sync
  Text 0,0,"Hours: "+Str$(Hour)
  Text 0,16,"Minutes: "+Str$(Mins)
  Text 0,32,"Seconds: "+Str$(Secs)
Loop
End

DecodeTime:
  T$ = Get Time$()
  Hour = VAL(Left$(T$,2))
  Mins = VAL(Mid$(T$,4)+Mid$(T$,5))
  Secs = VAL(Right$(T$,2))
Return

Setup:
  Sync On: Sync Rate 0: CLS 0
  Set Text Opaque
Return


The DecodeTime procedure simply gets the current time and places the hour, minute and seconds into the numeric values Hour, Mins and Secs. You can then use these variables in your program to do whatever you want.

The code in the main Do..Loop merely displays these values, so you can remove these lines - as long as you leave the Gosub DecodeTime line in.

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 21st Jan 2007 14:28     Edited: 22nd Jan 2007 18:33     | link | toggle

This thread is so busy I'm in danger of being rapped on the knuckles for making multiple posts!

Anyway, here's my entry for the challenge:

+ Code Snippet
Rem Project: DBC Clock Challenge Entry By TDK_Man

Gosub Setup
Gosub Make_Textures
Gosub Make_Objects

Rem Main Loop
Do
  Gosub DecodeTime
  Gosub DisplayTime
  Sync
Loop
End

Rem **********************
Rem Update The Time Wheels
Rem **********************
DisplayTime:
  Rem Hour Wheel
  Radius#=22.0: AngleInc=-15: Rem Angle of rotation 15*24=360
  YDist#=Radius#: YDistInc=AngleInc
  ZDist#=Radius#: ZDistInc=AngleInc
  StartAVal = Hour * AngleInc
  For N=1 To 24
    Y# = WrapValue((StartAVal - N*AngleInc)-(12*AngleInc))
    Z# = WrapValue((StartAVal - N*AngleInc)-(12*AngleInc))
    Position Object N,-6,newyvalue(0,Y#,YDist#),newzvalue(0,Z#,ZDist#)-42
  Next N
  Rem Minutes Wheel
  Radius#=60.0: AngleInc=-6: Rem Angle of rotation 6*60=360
  YDist#=Radius#: YDistInc=AngleInc
  ZDist#=Radius#: ZDistInc=AngleInc
  StartAVal = Mins * AngleInc
  For N=0 To 59
    Y# = WrapValue((StartAVal - N*AngleInc)-(30*AngleInc))
    Z# = WrapValue((StartAVal - N*AngleInc)-(30*AngleInc))
    Position Object N+100,0,newyvalue(0,Y#,YDist#),newzvalue(0,Z#,ZDist#)
  Next N
  Rem Seconds Wheel
  Radius#=60.0: AngleInc=-6: Rem Angle of rotation 6*60=360
  YDist#=Radius#: YDistInc=AngleInc
  ZDist#=Radius#: ZDistInc=AngleInc
  StartAVal = Secs * AngleInc
  For N=0 To 59
    Y# = WrapValue((StartAVal - N*AngleInc)-(30*AngleInc))
    Z# = WrapValue((StartAVal - N*AngleInc)-(30*AngleInc))
    Position Object N+200,6,newyvalue(0,Y#,YDist#),newzvalue(0,Z#,ZDist#)
  Next N
Return

Rem ****************
Rem Get Current Time
Rem ****************
DecodeTime:
  T$ = Get Time$()
  Hour = VAL(Left$(T$,2))
  Mins = VAL(Mid$(T$,4)+Mid$(T$,5))
  Secs = VAL(Right$(T$,2))
Return

Rem ******************
Rem Create The Objects
Rem ******************
Make_Objects:
  Rem Hour Cubes
  Radius#=27.0: AngleInc=15: Rem Angle of rotation 15*24=360
  YDist#=Radius#: YDistInc=AngleInc
  ZDist#=Radius#: ZDistInc=AngleInc
  For N=1 To 24
    Make Object Cube N,5: Rem Hours
    YRotate Object N,180: ZRotate Object N,180
    Fix Object Pivot N
    Texture Object N,N
    Y# = WrapValue(Y# - AngleInc)
    Z# = WrapValue(Z# - AngleInc)
    Position Object N,-6,newyvalue(0,Y#,YDist#),newzvalue(0,Z#,ZDist#)-37
  Next N
  Rem Minute Cubes
  Radius#=60.0: AngleInc=6: Rem Angle of rotation 6*60=360
  YDist#=Radius#: YDistInc=AngleInc
  ZDist#=Radius#: ZDistInc=AngleInc
  For N=0 To 59
    Make Object Cube N+100,5: Rem Minutes
    YRotate Object N+100,180: ZRotate Object N+100,180
    Fix Object Pivot N+100
    Texture Object N+100,N+100
    Y# = WrapValue(Y# - AngleInc)
    Z# = WrapValue(Z# - AngleInc)
    Position Object N+100,0,newyvalue(0,Y#,YDist#),newzvalue(0,Z#,ZDist#)
  Next N
  Rem Seconds Cubes
  Radius#=60.0: AngleInc=6: Rem Angle of rotation 6*60=360
  YDist#=Radius#: YDistInc=AngleInc
  ZDist#=Radius#: ZDistInc=AngleInc
  For N=0 To 59
    Make Object Cube N+200,5: Rem Seconds
    YRotate Object N+200,180: ZRotate Object N+200,180
    Fix Object Pivot N+200
    Texture Object N+200,N+200
    Y# = WrapValue(Y# - AngleInc)
    Z# = WrapValue(Z# - AngleInc)
    Position Object N+200,6,newyvalue(0,Y#,YDist#),newzvalue(0,Z#,ZDist#)
  Next N
  Rem Cone Pointers
  Make Object Cone 300,5
  ZRotate Object 300,270
  Position Object 300,-20,0,-20
  Make Object Cone 301,5
  ZRotate Object 301,90
  Position Object 301,20,0,-20
Return

Rem *******************
Rem Make Digit Textures
Rem *******************
Make_Textures:
  Rem Create Hour Number Textures
  Create Bitmap 1,320,200
  Ink 0,0
  For N=1 To 24: Rem 12 Hours
    CLS RGB(160,0,255)
    If N<10
      Text 1,1,"0"+Str$(N)
    Else
      Text 1,1,Str$(N)
    Endif
    Get Image N,0,0,17,18
  Next N
  Rem Create Minutes Number Textures
  For N=0 To 59: Rem 60 Minutes
    CLS RGB(255,0,100)
    If N<10
      Text 1,1,"0"+Str$(N)
    Else
      Text 1,1,Str$(N)
    Endif
    Get Image N+100,0,0,17,18
  Next N
  Rem Create Seconds Number Textures
  For N=0 To 59: Rem 60 Seconds
    CLS RGB(0,255,100)
    If N<10
      Text 0,0,"0"+Str$(N)
    Else
      Text 0,0,Str$(N)
    Endif
    Get Image N+200,0,0,17,16
  Next N
  Set Current Bitmap 0
  Delete Bitmap 1
Return

Rem ************************
Rem Initial Program Settings
Rem ************************
Setup:
  Set Display Mode 800,600,16
  Sync On: Sync Rate 0: CLS 0
  AutoCam Off
  Hide Mouse
  Backdrop On
  Color Backdrop 0
  Position camera 0,0,-150: Rem Front
  Point Camera 0,0,0
  Set Text Opaque
Return


As already pointed out, I set this challenge so I can't win it.

So, if I can make the effort to enter knowing I can't win, those of you who said they would enter could at least have a go right?

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Richard Davey

TGC Alumna


Joined: Tue Apr 30th 2002
Location: On the Jupiter Probe
Posted: 22nd Jan 2007 06:21           | link | toggle

I nearly have my entry finished, hold in there!!

Heavy on the Magick
Back to top
Photon Storm Find user on ICQ
Report this message as abusive
Lucifer

User


Joined: Mon Dec 26th 2005
Location: Iceland
Posted: 22nd Jan 2007 13:51           | link | toggle

Quote: "3. All challenge entries are to be written in the standard un-enhanced version of DBC. You can actually use any version of DBC, but for the benefit of those who do not have the Enhancement Pack, you may NOT use any of the additional commands if you have them.*"

cant you remove this rule since the enhancement pack is free now? and tdk, when did you become a mod? that's cool..


i like pancakes..
Back to top
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 22nd Jan 2007 14:37           | link | toggle

Quote: "cant you remove this rule since the enhancement pack is free now?"

It's not technically free. You can only download it if you are a registered purchaser of DBC.

But, if everyone agrees beforehand, this rule can be ignored (notice the little * at the end of the rule). But yes, the plan was to scrap it at some time anyway.

Quote: "when did you become a mod?"

The first time for DB, about five years ago. On this board, last week.

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Google Ad
Back to top
 
Phaelax

User


Joined: Wed Apr 16th 2003
Location: Ohio
Posted: 22nd Jan 2007 15:43           | link | toggle

Quote: "so I've borrowed heavily from the DBPro Challenge rules and modified them for DBC - I hope they don't mind."
I don't think we'll mind.

So who's judging this one since you're entering this challenge that you've set?

Back to top
Zimnox Find user on ICQ Send AIM user a message
Report this message as abusive
Latch

User


Joined: Sun Jul 23rd 2006
Location: Cyberspace
Posted: 22nd Jan 2007 17:26           | link | toggle

Entry 1

I decided to go digital for my entry(ies):

+ Code Snippet
`**************************************
`* Title  : bouncing_clock
`* Author : latch
`* Date   : 1/21/2007
`* Version:
`**************************************

rem ------ Set Up Display -------------
autocam off
set display mode 800,600,32
sync on
sync rate 60
hide mouse

rem =============================================================
rem = SETUP
rem =============================================================
   rem object attribute arrays
   dim mass#(6)
   dim force#(6)
   dim accel#(6)
   dim ivel#(6)
   dim fvel#(6)
      rem initialize final velocity
      for obj = 1 to 6
         fvel#(obj)=-1
      next obj

   dim sideways(6)
   dim rot#(6)
   dim time#(6)
   dim distance#(6)
   dim x#(12)
   dim y#(12)
   dim z#(12)

   randomize timer()

   rem make a ground for reference
   box 2,2,9,9
   get image 1000,0,0,11,11
   make matrix 1,1000,1000,10,10
   prepare matrix texture 1,1000,1,1
   update matrix 1

   rem info
   set camera view 0,0,1,1
   center text screen width()/2,screen height()/2,"Initializing Display..."

   gosub _digital_numbers
   gosub _blocks
   position camera 500,50,350

   `sync

rem =============================================================
rem = MAIN
rem =============================================================

   set camera view 0,0,screen width(),screen height()

   do
      gosub _time_pos
      for obj = 1 to 6
         gosub _bounce
         `sync
      next obj
      sync
   loop

   end

rem =============================================================
rem = SUB-ROUTINES
rem =============================================================
   _time_pos:

      a$=get time$()
      sizet=len(a$)

      rem get seconds
      sec1=val(mid$(a$,sizet))
      sec2=val(mid$(a$,sizet-1))
      rem get minutes
      min1=val(mid$(a$,sizet-3))
      min2=val(mid$(a$,sizet-4))
      rem get hours
      hour1=val(mid$(a$,sizet-6))
      hour2=val(mid$(a$,sizet-7))

      rem put numbers on cubes
      texture object 6,100+sec1
      texture object 5,100+sec2
      texture object 4,100+min1
      texture object 3,100+min2
      texture object 2,100+hour1
      texture object 1,100+hour2

   return
`-------------------------------------------------------------------
   _digital_numbers:

      rem draw everything in background
      create bitmap 1,screen width(),screen height()

      rem array to store number graphics
      dim digital(9,7)
      for num = 0 to 9
         for value = 1 to 7
            read digital(num,value)
         next value
      next num

      rem make across bar
      f_triangle(0,10*2,10,5*2,10,15*2,rgb(255,255,255))
      box 10,5*2,40*2,15*2
      f_triangle(81,10,91,20,81,30,rgb(255,255,255))
      get image 1,0,5*2,92,31
      cls

      rem make up-down bar
      f_triangle(10,10,0,20,20,20,rgb(255,255,255))
      box 0,21,20,80
      f_triangle(0,81,10,91,20,81,rgb(255,255,255))
      get image 2,0,0,21,92
      cls

      sprite 2,82,102,2
      hide sprite 2
      sprite 1,0,100,1
      hide sprite 1

      rem create all numbers
      for num = 0 to 9
         for value = 1 to 7
            select value
               case 1
                  if digital(num,value) = 2 then paste sprite 2,0,2
               endcase
               case 2
                  if digital(num,value) = 1 then paste sprite 1,12,0
               endcase
               case 3
                  if digital(num,value) = 2 then paste sprite 2,95,2
               endcase
               case 4
                  if digital(num,value) = 2 then paste sprite 2,0,87
               endcase
               case 5
                  if digital(num,value) = 1 then paste sprite 1,12,85
               endcase
               case 6
                  if digital(num,value) = 2 then paste sprite 2,95,87
               endcase
               case 7
                  if digital(num,value) = 1 then paste sprite 1,12,170
               endcase
            endselect
         next value
         sync
         get image 100+num,0,0,116,191
         cls
      next num

      rem finished with array, sprites, bitmap
      undim digital(9,7)
      delete sprite 1
      delete sprite 2
      delete bitmap 1

   return
`----------------------------------------------------------------
   _blocks:

      rem make cubes to hold digital numbers
      start=-1
      for obj = 1 to 6
         inc start
         make object cube obj,25
         position object obj,(start*32)+425,get ground height(1,500,500)+25,500
      next obj

   return
`----------------------------------------------------------------
   _bounce:

      gravity#=-9.8

      if fvel#(obj) <= 0
         time#(obj)=0
         mass#(obj)=10
         sideways(obj)=rnd(4)-2
         
         force#(obj)=rnd(600)
         accel#(obj)=accel_2(force#(obj),mass#(obj))
         ivel#(obj)=vel_2(0.0,accel#(obj),1.0)
         
         x#(obj)=object position x(obj)
         y#(obj)=object position y(obj)
         z#(obj)=object position z(obj)

         fvel#(obj)=1

      else

         time#(obj)=time#(obj)+.05
         fvel#(obj)=vel_2(ivel#(obj),gravity#,time#(obj))
         distance#(obj)=distance_2(fvel#(obj),time#(obj))
         if distance#(obj) < 0 then distance#(obj) = 0
         rot#(obj)=wrapvalue(rot#(obj)+sideways(obj))
         position object obj,x#(obj),y#(obj)+distance#(obj),z#(obj)
         rotate object obj,rot#(obj),rot#(obj),wrapvalue(rot#(obj)*-2)
      endif

   return
`----------------------------------------------------------------


rem =============================================================
rem = FUNCTIONS
rem =============================================================
   function accel_2(force#,mass#)
      a#=force#/mass#
   endfunction a#
`-----------------------------------------------------------------
   function distance_2(velocity#,time#)
      s#=velocity#*time#
   endfunction s#
`-----------------------------------------------------------------
   function vel_2(ivelocity#,acceleration#,time#)
      v#=ivelocity#+(acceleration#*time#)
   endfunction v#
`-----------------------------------------------------------------
   function f_triangle(x1,y1,x2,y2,x3,y3,color)

      sync rate 0

      ink color,0
      line x1,y1,x2,y2
      line x2,y2,x3,y3
      line x3,y3,x1,y1

      midx=(x1+x2+x3)/3
      midy=(y1+y2+y3)/3

      fill(midx,midy,color)

      sync rate 60

   endfunction
`-----------------------------------------------------------------------
   function fill(x,y,color)
      if point(x,y) <> color
         box x,y,x,y
         fill(x+1,y,color)
         fill(x,y+1,color)
         fill(x-1,y,color)
         fill(x,y-1,color)
      endif
   endfunction
`------------------------------------------------------------------------
rem =============================================================
rem = DATA STATMENTS
rem =============================================================

rem 7 positions make up the graphic for a number 3 top 3 mid 1 bottom
rem 1=horizontal section
rem 2=vertical section
rem 0=empty space (ex number 2 would be 0,1,2,2,1,0,1)

   data 2,1,2,2,0,2,1
   data 0,0,2,0,0,2,0
   data 0,1,2,2,1,0,1
   data 0,1,2,0,1,2,1
   data 2,0,2,0,1,2,0
   data 2,1,0,0,1,2,1
   data 2,1,0,2,1,2,1
   data 0,1,2,0,0,2,0
   data 2,1,2,2,1,2,1
   data 2,1,2,0,1,2,1


Enjoy your day.
Back to top
Report this message as abusive
Phaelax

User


Joined: Wed Apr 16th 2003
Location: Ohio
Posted: 22nd Jan 2007 17:27           | link | toggle

I don't know how you people can tolerate using DBC. I keep getting errors about labels not existing for my subroutines, yet DBP has no trouble finding them. No UDT or globals, grrr.

Back to top
Zimnox Find user on ICQ Send AIM user a message
Report this message as abusive
Latch

User


Joined: Sun Jul 23rd 2006
Location: Cyberspace
Posted: 22nd Jan 2007 17:34           | link | toggle

entry 2

variation of entry 1

+ Code Snippet
`**************************************
`* Title  : bouncing_clock_2
`* Author : latch
`* Date   : 1/21/2007
`* Version:
`**************************************

rem ------ Set Up Display -------------
autocam off
set display mode 800,600,32
sync on
sync rate 60
hide mouse

rem =============================================================
rem = SETUP
rem =============================================================
   rem object attribute arrays
   dim mass#(6)
   dim force#(6)
   dim accel#(6)
   dim ivel#(6)
   dim fvel#(6)
      rem initialize final velocity
      for obj = 1 to 6
         fvel#(obj)=-1
      next obj

   dim sideways(6)
   dim rot#(6)
   dim time#(6)
   dim distance#(6)
   dim x#(12)
   dim y#(12)
   dim z#(12)

   randomize timer()

   rem make a ground for reference
   box 2,2,9,9
   get image 1000,0,0,11,11
   make matrix 1,1000,1000,10,10
   prepare matrix texture 1,1000,1,1
   update matrix 1

   rem info
   set camera view 0,0,1,1
   center text screen width()/2,screen height()/2,"Initializing Objects..."

   gosub _digital_numbers

   gosub _blocks

   position camera 500,50,350

   `sync

rem =============================================================
rem = MAIN
rem =============================================================

   set camera view 0,0,screen width(),screen height()

   do
      gosub _time_pos
      for obj = 1 to 6
         gosub _bounce
         `sync
      next obj
      sync
   loop

   end

rem =============================================================
rem = SUB-ROUTINES
rem =============================================================
   _time_pos:

      a$=get time$()
      sizet=len(a$)

      rem get seconds
      sec1=val(mid$(a$,sizet))
      sec2=val(mid$(a$,sizet-1))
      rem get minutes
      min1=val(mid$(a$,sizet-3))
      min2=val(mid$(a$,sizet-4))
      rem get hours
      hour1=val(mid$(a$,sizet-6))
      hour2=val(mid$(a$,sizet-7))

      rem put numbers on cubes
      texture object 6,100+sec1
      texture object 5,100+sec2
      texture object 4,100+min1
      texture object 3,100+min2
      texture object 2,100+hour1
      texture object 1,100+hour2

   return
`-------------------------------------------------------------------
   _digital_numbers:

      rem draw everything in background
      create bitmap 1,screen width(),screen height()

      rem array to store number graphics
      dim digital(9,7)
      for num = 0 to 9
         for value = 1 to 7
            read digital(num,value)
         next value
      next num

      rem make across bar
      f_triangle(0,10*2,10,5*2,10,15*2,rgb(255,255,255))
      box 10,5*2,40*2,15*2
      f_triangle(81,10,91,20,81,30,rgb(255,255,255))
      get image 1,0,5*2,92,31
      cls

      rem make up-down bar
      f_triangle(10,10,0,20,20,20,rgb(255,255,255))
      box 0,21,20,80
      f_triangle(0,81,10,91,20,81,rgb(255,255,255))
      get image 2,0,0,21,92
      cls

      sprite 2,82,102,2
      hide sprite 2
      sprite 1,0,100,1
      hide sprite 1

      rem create all numbers
      for num = 0 to 9
         for value = 1 to 7
            select value
               case 1
                  if digital(num,value) = 2 then paste sprite 2,0,2
               endcase
               case 2
                  if digital(num,value) = 1 then paste sprite 1,12,0
               endcase
               case 3
                  if digital(num,value) = 2 then paste sprite 2,95,2
               endcase
               case 4
                  if digital(num,value) = 2 then paste sprite 2,0,87
               endcase
               case 5
                  if digital(num,value) = 1 then paste sprite 1,12,85
               endcase
               case 6
                  if digital(num,value) = 2 then paste sprite 2,95,87
               endcase
               case 7
                  if digital(num,value) = 1 then paste sprite 1,12,170
               endcase
            endselect
         next value
         sync
         get image 100+num,0,0,116,191
         cls
      next num

      rem finished with array, sprites, bitmap
      undim digital(9,7)
      delete sprite 1
      delete sprite 2
      delete bitmap 1

   return
`----------------------------------------------------------------
   _blocks:

      rem make cubes to hold digital numbers
      start=-1
      for obj = 1 to 6
         inc start
         make object plain obj,25,25
         position object obj,(start*30)+425,get ground height(1,500,500)+25,500
         make object cube obj+6,25
         position object obj+6,(start*30)+425,get ground height(1,500,500)+25,500
         ghost object on obj+6

         `SET OBJECT Object Number, Wireframe, Transparency, Cull
         set object obj,1,0,0
      next obj

   return
`----------------------------------------------------------------
   _bounce:

      gravity#=-9.8

      if fvel#(obj) <= 0
         time#(obj)=0
         mass#(obj)=10
         sideways(obj)=rnd(4)-2
         `frontways=rnd(2)-1
         force#(obj)=rnd(600)
         accel#(obj)=accel_2(force#(obj),mass#(obj))
         ivel#(obj)=vel_2(0.0,accel#(obj),1.0)
         `fvel#(obj)=0
         x#(obj)=object position x(obj)
         y#(obj)=object position y(obj)
         z#(obj)=object position z(obj)
         x#(obj+6)=object position x(obj+6)
         y#(obj+6)=object position y(obj+6)
         z#(obj+6)=object position z(obj+6)

         fvel#(obj)=1

      else

         time#(obj)=time#(obj)+.05
         fvel#(obj)=vel_2(ivel#(obj),gravity#,time#(obj))
         distance#(obj)=distance_2(fvel#(obj),time#(obj))
         if distance#(obj) < 0 then distance#(obj) = 0
         rot#(obj)=wrapvalue(rot#(obj)+sideways(obj))
         position object obj,x#(obj),y#(obj)+distance#(obj),z#(obj)
         position object obj+6,x#(obj+6),y#(obj+6)+distance#(obj),z#(obj+6)
         rotate object obj,rot#(obj),rot#(obj),wrapvalue(rot#(obj)*-2)

      endif


   return
`----------------------------------------------------------------


rem =============================================================
rem = FUNCTIONS
rem =============================================================
   function accel_2(force#,mass#)
      a#=force#/mass#
   endfunction a#
`-----------------------------------------------------------------
   function distance_2(velocity#,time#)
      s#=velocity#*time#
   endfunction s#
`-----------------------------------------------------------------
   function vel_2(ivelocity#,acceleration#,time#)
      v#=ivelocity#+(acceleration#*time#)
   endfunction v#
`-----------------------------------------------------------------
   function f_triangle(x1,y1,x2,y2,x3,y3,color)

      sync rate 0

      ink color,0
      line x1,y1,x2,y2
      line x2,y2,x3,y3
      line x3,y3,x1,y1

      midx=(x1+x2+x3)/3
      midy=(y1+y2+y3)/3

      fill(midx,midy,color)

      sync rate 60

   endfunction
`-----------------------------------------------------------------------
   function fill(x,y,color)
      if point(x,y) <> color
         box x,y,x,y
         fill(x+1,y,color)
         fill(x,y+1,color)
         fill(x-1,y,color)
         fill(x,y-1,color)
      endif
   endfunction
`------------------------------------------------------------------------
rem =============================================================
rem = DATA STATMENTS
rem =============================================================

rem 7 positions make up the graphic for a number 3 top 3 mid 1 bottom
rem 1=horizontal section
rem 2=vertical section
rem 0=empty space (ex number 2 would be 0,1,2,2,1,0,1)

   data 2,1,2,2,0,2,1
   data 0,0,2,0,0,2,0
   data 0,1,2,2,1,0,1
   data 0,1,2,0,1,2,1
   data 2,0,2,0,1,2,0
   data 2,1,0,0,1,2,1
   data 2,1,0,2,1,2,1
   data 0,1,2,0,0,2,0
   data 2,1,2,2,1,2,1
   data 2,1,2,0,1,2,1


Enjoy your day.
Back to top
Report this message as abusive
Latch

User


Joined: Sun Jul 23rd 2006
Location: Cyberspace
Posted: 22nd Jan 2007 17:51           | link | toggle

Entry 3

+ Code Snippet
remstart
   -------------------------------------------------------------------
   program name: matrix clock
   -------------------------------------------------------------------
   written by: latch
   date: 18-01-2007
   -------------------------------------------------------------------
   comments: clock using matrix point heights
   -------------------------------------------------------------------
remend

   set display mode 800,600,32
   autocam off
   sync on
   sync rate 60
   hide mouse


rem =============================================================
rem = Array to hold number data
rem =============================================================
   tilex=69
   tilez=18

   dim number(9,tilez,tilex)

   for n = 0 to 9
      for z = 0 to tilez
         for x = 0 to 8
            read number(n,z,x)
         next x
      next z
   next n

rem =============================================================
rem = CREATE MATRIX
rem =============================================================

   make matrix 1,tilex,tilez,tilex,tilez

   rem add colons
   for z = 0 to tilez
      for x = 0 to 1
         read y
         set matrix height 1,x+46,z,y*3
         set matrix height 1,x+22,z,y*3
      next x
   next z

   `SET MATRIX Matrix Number, Wireframe, Transparency, Cull, Filter, Light, Fog, Ambient
   set matrix 1,1,1,1,1,1,1,0
   update matrix 1

rem =============================================================
rem = MAKE CASE TO HOLD CLOCK
rem =============================================================

   make object box 1,69,6,18
   color object 1,rgb(0,10,255)
   ghost object on 1
   position object 1,34.5,3,9

   position camera tilex/2,50,-10
   xrotate camera 75

rem =============================================================
rem = MAIN LOOP
rem =============================================================

gosub _lighting
color backdrop 0

do

   gosub _time_pos

   gosub _move_spot

   rem move camera left and right
   camx#=camera position x()
   if leftkey()=1 then camx#=camera position x()-.5
   if rightkey()=1 then camx#=camera position x()+.5
   position camera camx#,camera position y(),camera position z()

   rem info
   text 0,0,"Move camera left + right with arrow keys"

   sync

loop

end

rem =============================================================
rem = SUB-ROUTINES
rem =============================================================

   _time_pos:

      height=5
      a$=get time$()
      sizet=len(a$)

      rem get seconds
      sec1=val(mid$(a$,sizet))
      sec2=val(mid$(a$,sizet-1))
      rem get minutes
      min1=val(mid$(a$,sizet-3))
      min2=val(mid$(a$,sizet-4))
      rem get hours
      hour1=val(mid$(a$,sizet-6))
      hour2=val(mid$(a$,sizet-7))

      for z = 0 to tilez
         for x = 0 to 8
            set matrix height 1,x+60,z,number(sec1,z,x)*height
            set matrix height 1,x+49,z,number(sec2,z,x)*height
            set matrix height 1,x+36,z,number(min1,z,x)*height
            set matrix height 1,x+25,z,number(min2,z,x)*height
            set matrix height 1,x+12,z,number(hour1,z,x)*height
            set matrix height 1,x+1,z,number(hour2,z,x)*height
         next x
      next z

      gosub _smooth_matrix

      update matrix 1

   return
`------------------------------------------------------------------------
   _smooth_matrix:

      rem from DarkBASIC example code
      rem Author : DBS-LB
      rem Date   : 19th July 2000

      rem Use matrix normals to make it smooth
      for z=1 to tilez
         for x=1 to tilex

            rem Get matrix heights
            h8#=get matrix height(1,x,z-1)
            h4#=get matrix height(1,x-1,z)
            h#=get matrix height(1,x,z)
            h2#=get matrix height(1,x,z)

            rem Calculate projected angle X using heights
            x1#=(x-1)*25.0 : y1#=h#
            x2#=(x+0)*25.0 : y2#=h4#
            dx#=x2#-x1#
            dy#=y2#-y1#
            ax#=atanfull(dx#,dy#)
            ax#=wrapvalue(90-ax#)

            rem Calculate projected angle Z using heights
            z1#=(z-1)*25.0 : y1#=h2#
            z2#=(z+0)*25.0 : y2#=h8#
            dz#=z2#-z1#
            dy#=y2#-y1#
            az#=atanfull(dz#,dy#)
            az#=wrapvalue(90-az#)

            rem Make normal from projected angle
            nx#=sin(ax#)
            ny#=cos(ax#)
            nz#=sin(az#)

            rem Setting matrix normal for smoothness
            set matrix normal 1,x,z,nx#,ny#,nz#

         next x
      next z

   return
`------------------------------------------------------------------------
   _lighting:

      make light 1
      make light 2
      make light 3

      set point light 0,-30,5,10
      color light 0,rgb(0,0,255)

      set point light 1,100,5,10
      color light 1,rgb(0,0,255)

      set point light 2,34.5,8,20
      color light 2,rgb(0,0,255)

      set spot light 3,5,15
      color light 3,rgb(0,200,100)
      position light 3,35,60,0
      point light 3,tilex/2,0,tilez/2

      set ambient light 0

   return
`-------------------------------------------------------------------------
   _move_spot:

      ang#=wrapvalue(ang#+.5)
      rotate light 3,ang#,ang#,0

   return

rem =============================================================
rem = DATA STATEMENTS
rem =============================================================

   rem 0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,1,1,1,0,0,0
   data 0,0,1,1,1,1,1,0,0
   data 0,1,1,1,1,1,1,1,0
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 1,1,0,0,0,0,0,1,1
   data 1,1,0,0,0,0,0,1,1
   data 1,1,0,0,0,0,0,1,1
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 0,1,1,1,1,1,1,1,0
   data 0,0,1,1,1,1,1,0,0
   data 0,0,0,1,1,1,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0

   rem 1
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,1,0
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,0,1,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0

   rem 2
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,1,1,1,1,0,0
   data 0,0,1,1,1,1,1,1,0
   data 0,1,1,1,1,1,1,0,0
   data 1,1,1,0,0,0,0,0,0
   data 1,1,1,0,0,0,0,0,0
   data 1,1,1,0,0,0,0,0,0
   data 0,1,1,1,1,1,0,0,0
   data 0,0,1,1,1,1,1,0,0
   data 0,0,0,1,1,1,1,1,0
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,1,1,1,1,1,1,0
   data 0,1,1,1,1,1,1,0,0
   data 0,0,1,1,1,1,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0

   rem 3
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,1,1,1,0,0,0
   data 0,0,1,1,1,1,1,0,0
   data 0,0,0,1,1,1,1,1,0
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,1,1,1,1,1,0
   data 0,0,1,1,1,1,1,0,0
   data 0,0,0,1,1,1,1,1,0
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,1,1,1,1,1,0
   data 0,0,1,1,1,1,1,0,0
   data 0,0,0,1,1,1,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0

   rem 4
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,1,0
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,1,1,1,1,1,1
   data 0,0,1,1,1,1,1,1,1
   data 0,1,1,1,1,1,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 0,1,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,0,1,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0

   rem 5
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,1,1,1,0,0,0
   data 0,0,1,1,1,1,1,0,0
   data 0,0,0,1,1,1,1,1,0
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,1,1,1,1,1,0
   data 0,0,1,1,1,1,1,0,0
   data 0,1,1,1,1,1,0,0,0
   data 1,1,1,0,0,0,0,0,0
   data 1,1,1,0,0,0,0,0,0
   data 1,1,1,0,0,0,0,0,0
   data 0,1,1,1,1,1,1,0,0
   data 0,0,1,1,1,1,1,1,0
   data 0,0,0,1,1,1,1,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0

   rem 6
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,1,1,1,0,0,0
   data 0,0,1,1,1,1,1,0,0
   data 0,1,1,1,1,1,1,1,0
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,1,1,1,1,1,0
   data 1,1,1,1,1,1,1,0,0
   data 1,1,1,1,1,1,0,0,0
   data 1,1,1,0,0,0,0,0,0
   data 1,1,1,0,0,0,0,0,0
   data 1,1,1,0,0,0,0,0,0
   data 0,1,1,1,1,1,0,0,0
   data 0,0,1,1,1,1,1,0,0
   data 0,0,0,1,1,1,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0

   rem 7
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,1,0
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,1,0,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 0,1,1,1,1,1,1,1,0
   data 0,0,1,1,1,1,1,0,0
   data 0,0,0,1,1,1,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0

   rem 8
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,1,1,1,0,0,0
   data 0,0,1,1,1,1,1,0,0
   data 0,1,1,1,1,1,1,1,0
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 0,1,1,1,1,1,1,1,0
   data 0,0,1,1,1,1,1,0,0
   data 0,1,1,1,1,1,1,1,0
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 0,1,1,1,1,1,1,1,0
   data 0,0,1,1,1,1,1,0,0
   data 0,0,0,1,1,1,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0

   rem 9
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,1,1,1,0,0,0
   data 0,0,1,1,1,1,1,0,0
   data 0,0,0,1,1,1,1,1,0
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,0,0,0,1,1,1
   data 0,0,0,1,1,1,1,1,1
   data 0,0,1,1,1,1,1,1,1
   data 0,1,0,1,1,1,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 1,1,1,0,0,0,1,1,1
   data 0,1,1,1,1,1,1,1,0
   data 0,0,1,1,1,1,1,0,0
   data 0,0,0,1,1,1,0,0,0
   data 0,0,0,0,0,0,0,0,0
   data 0,0,0,0,0,0,0,0,0

   rem colon
   data 0,0
   data 0,0
   data 0,0
   data 0,0
   data 0,0
   data 0,0
   data 1,1
   data 1,1
   data 0,0
   data 0,0
   data 0,0
   data 1,1
   data 1,1
   data 0,0
   data 0,0
   data 0,0
   data 0,0
   data 0,0
   data 0,0


Enjoy your day.
Back to top
Report this message as abusive
Latch

User


Joined: Sun Jul 23rd 2006
Location: Cyberspace
Posted: 22nd Jan 2007 18:18           | link | toggle

Entry 4

I wrote this without planning it out (the code shows it ) - I had a picture in my mind of what I wanted to happen - that picture never really materialized, but I actually got a chuckle at how it was progressing so I decided to stop working on it and leave it like it is.

+ Code Snippet
`**************************************
`* Title  : Clock Sapien
`* Author : latch
`* Date   : 11-01-2007
`* Version:
`**************************************

rem =============================================================
rem = set up display
rem =============================================================
autocam off
set display mode 800,600,32
sync on
sync rate 60
hide mouse

position camera 0,80,-200
point camera 0,40,0

dim man(1000)

box 1,1,10,10
get image 1,0,0,11,11

ground=make_floor(1,100000.0,100000.0,0.0,-100.0,0.0,1,200.0,200.0)

for n = 20 to 60
   man(n)=stick_man(n)
   loop object man(n)
   set object speed man(n),rnd(25)+25
   center text screen width()/2,20,"Initializing Object Data..."
   sync
next n

randomize timer()


      cls 0
      ink rgb(255,255,255),0
      text 0,0,"I'M LATE!!  I'M LATE!!"
      get image 3,0,0,140,17

      sprite 1,330,10,3
      set sprite 3,1,0

      set camera view 0,0,screen width(),screen height()

do
      create bitmap 1,192,128
      ink rgb(0,255,0),0
      box 0,0,127,127
      ink 0,0
      text 33,64,get time$()
      get image 2,0,0,128,128
      delete bitmap 1

      for obj = 20 to 60

         move object man(obj),rnd(10)
         yrotate object man(obj),wrapvalue(object angle y(man(obj))+rnd(20)-10)
         texture object man(obj),2
      next obj

      objx#=object position x(man(20))
      objy#=object position y(man(20))
      objz#=object position z(man(20))
      angy#=object angle y(man(20))

      set camera to follow objx#,objy#,objz#,angy#,150,50,30,1


      sync
loop

end

rem =============================================================
rem = FUNCTIONS
rem =============================================================

   function is_even(num)
      true = 1
      false = 0
      test#=num/2.0
      if test# > (num/2) then exitfunction false
   endfunction true
`----------------------------------------------------------------
   function avail_obj(obj)
      while object exist(obj)=1
         inc obj
      endwhile
   endfunction obj
`-----------------------------------------------------------------

function stick_man(obj)
   rem =============================================================
   rem = Create character
   rem =============================================================

   rem variables
   body=avail_obj(obj)
   joint=avail_obj(body+1)
   head=avail_obj(body+2)
   chimney=avail_obj(body+3)
   bone=body

         rem right leg
         r_hip=1:r_thigh=2:r_knee=3:r_shin=4

         rem left leg
         l_hip=5:l_thigh=6:l_knee=7:l_shin=8

         rem right arm
         r_shold=9:r_bi=10:r_elbow=11:r_arm=12

         rem left arm
         l_shold=13:l_bi=14:l_elbow=15:l_arm=16

         rem head
         kneck=17:head=18:chimney=19

   rem body parts
   make object cylinder body,50
   scale object body,25,70,25
   make mesh from object bone,body
   scale object body,100,100,100
   make object cube head,25
   make mesh from object head,head
   make object cylinder chimney,5
   scale object chimney,60,400,60
   make mesh from object chimney,chimney

   rem joints
   make object sphere joint,50
   scale object joint,36,36,36
   make mesh from object joint,joint
   scale object joint,100,100,100

   rem create limbs
   count = 0
   for lmb=1 to 16
      inc count
      if is_even(lmb)=1
         add limb body,lmb,bone
      else
         add limb body,lmb,joint
      endif

      rem link limbs
      if count > 1
         link limb body,lmb,lmb-1
      endif

      if count = 4 then count = 0

   next lmb

   rem neck head and smoke stack
   add limb body,kneck,bone
   add limb body,head,head
   link limb body,head,kneck
   add limb body,chimney,chimney
   link limb body,chimney,head

   rem initial position of limbs
         rem right leg
   offset limb body,r_hip,-12,-26,0
   offset limb body,r_thigh,0,-20,0
   offset limb body,r_knee,0,-20,0
   offset limb body,r_shin,0,-20,0

         rem left leg
   offset limb body,l_hip,12,-26,0
   offset limb body,l_thigh,0,-20,0
   offset limb body,l_knee,0,-20,0
   offset limb body,l_shin,0,-20,0

         rem right arm
   offset limb body,r_shold,-33,20,0
   offset limb body,r_bi,-2,-20,0
   offset limb body,r_elbow,0,-20,0
   rotate limb body,r_elbow,300,0,0
   offset limb body,r_arm,0,-20,0

         rem left arm
   offset limb body,l_shold,33,20,0
   offset limb body,l_bi,2,-20,0
   offset limb body,l_elbow,0,-20,0
   rotate limb body,l_elbow,300,0,0
   offset limb body,l_arm,0,-20,0

         rem head
   offset limb body,kneck,0,20,0
   offset limb body,head,0,20,0
   offset limb body,chimney,5,20,-8

   rem object animation
   set object keyframe body,0
   rotate limb body,r_hip,310,0,0
   rotate limb body,r_knee,60,0,0
   rotate limb body,r_shold,30,0,0
   rotate limb body,l_hip,20,0,0
   rotate limb body,l_knee,20,0,0
   rotate limb body,l_shold,310,0,0
   set object keyframe body,10
   rotate limb body,r_hip,0,0,0
   rotate limb body,r_knee,3,0,0
   rotate limb body,r_shold,330,0,0
   rotate limb body,l_hip,340,0,0
   rotate limb body,l_knee,60,0,0
   rotate limb body,l_shold,0,0,0
   set object keyframe body,20
   rotate limb body,r_hip,20,0,0
   rotate limb body,r_knee,30,0,0
   rotate limb body,r_shold,300,0,0
   rotate limb body,l_hip,310,0,0
   rotate limb body,l_knee,30,0,0
   rotate limb body,l_shold,20,0,0
   set object keyframe body,28
   rotate limb body,l_hip,0,0,0
   rotate limb body,l_knee,3,0,0
   rotate limb body,l_shold,359,0,0
   rotate limb body,r_hip,359,0,0
   rotate limb body,r_knee,10,0,0
   rotate limb body,r_shold,0,0,0
   set object keyframe body,38

   rem cleanup unneeded meshes and objects
   delete object chimney
   delete mesh chimney
   delete object head
   delete mesh head
   delete object joint
   delete mesh joint
   delete mesh bone

endfunction body
`-----------------------------------------------------------------------------
function make_floor(obj,width#,height#,posx#,posy#,posz#,texture,across#,down#)

   rem check for exisiting objects
   while object exist(obj)=1
      inc obj
   endwhile

   rem make the actual plain object and rotate it flat
   make object plain obj,width#,height#
   xrotate object obj,90
   fix object pivot obj

   rem texture and scale the texture to tile it or not
   texture object obj,texture
   scale object texture obj,across#,down#

   rem set the initial position of the floor
   position object obj,posx#,posy#,posz#
endfunction obj


Enjoy your day.
Back to top
Report this message as abusive
Phaelax

User


Joined: Wed Apr 16th 2003
Location: Ohio
Posted: 22nd Jan 2007 18:21           | link | toggle

Rather than just turn off the pixels to the digits we don't need to display, why not just 'drop' them?

+ Code Snippet
`**************************************
`* Title  : Drop Clock
`* Author : Phaelax
`* Date   : 1-22-2007
`**************************************
speed = 5
radius = 5
size = radius*2
spacing = size*4

max_display = 120


offsetX = (screen width() - (8*size+7*spacing))/2
offsetY = (screen height() - 5*size)/2

rem x,y,active,targetX,targetY
dim dots(max_display, 5)
dim grav#(max_display)

for i = 1 to max_display
   dots(i, 1) = rnd(640)
   dots(i, 2) = rnd(480)
   dots(i, 3) = 0
   grav#(i) = 0.1
next i


REM STUFF
dim digits(10,3,5)

for i = 1 to 10
   for y = 1 to 5
      for x = 1 to 3
         read z
         digits(i,x,y) = z
      next x
   next y
next i


sync on
sync rate 60

ink rgb(0,255,0),0


DO
   cls

   gosub _update
   gosub _position

sync
LOOP




_position:
   for i = 1 to max_display
      if dots(i,3) = 1
         if abs(dots(i,4)-dots(i,1)) < speed AND abs(dots(i,5)-dots(i,2)) < speed
            dots(i,1) = dots(i,4)
            dots(i,2) = dots(i,5)
         else
            angle# = atanfull(dots(i,4)-dots(i,1),dots(i,5)-dots(i,2))
            dots(i,1) = dots(i,1) + sin(angle#)*speed
            dots(i,2) = dots(i,2) + cos(angle#)*speed
         endif
      else
         if dots(i,2) < 479-radius
            dots(i,2) = dots(i,2)+grav#(i)
            grav#(i) = grav#(i) + 0.1
            if grav#(i) > 6 then grav#(i) = 6
            if dots(i,2) > 480-size
               dots(i,2) = 480-size
            endif
         endif
      endif
      `circle dots(i,1), dots(i,2), radius
      box dots(i,1)-radius, dots(i,2)-radius,dots(i,1)+radius, dots(i,2)+radius
   next i
RETURN


_update:
   if seconds <> val(substring$(get time$(),6, 8))
      time$ = get time$()
      seconds = val(substring$(time$,6, 8))
      hour = val(substring$(time$,0, 2))
      rest$ = substring$(time$,2,9)
      if hour > 12 then hour = hour-12
      hr$ = str$(hour)
      if len(hr$) = 1 then hr$ = " "+hr$
      time$ = hr$+rest$
      j = 0
      for i = 1 to len(time$)
         d$ = mid$(time$, i)
         if d$ <> ":"
            digit = val(d$)
            for y = 1 to 5
               for x = 1 to 3
                  if digits(digit+1,x,y) = 1
                     inc j
                     dots(j,3) = 1
                     dots(j,4) = offsetX+x*size + spacing*(i-1)
                     dots(j,5) = offsetY+y*size
                  else
                     inc j
                     dots(j,3) = 0
                  endif
               next x
            next y
         else
            inc j
            dots(j,3) = 1
            dots(j,4) = offsetX+2*size + spacing*(i-1)
            dots(j,5) = offsetY+1*size
            inc j
            dots(j,3) = 1
            dots(j,4) = offsetX+2*size + spacing*(i-1)
            dots(j,5) = offsetY+5*size
         endif
      next i
   endif
RETURN


REM Returns a substring of string 's'
REM beginIndex, inclusive and starts at 0
REM endIndex, exclusive
function substring$(s$, beginIndex, endIndex)
   s$ = left$(s$, endIndex)
   s$ = right$(s$, len(s$)-beginIndex)
endfunction s$


REM DATA
zero:
data 1,1,1
data 1,0,1
data 1,0,1
data 1,0,1
data 1,1,1

one:
data 1,1,0
data 0,1,0
data 0,1,0
data 0,1,0
data 1,1,1

two:
data 1,1,1
data 0,0,1
data 1,1,1
data 1,0,0
data 1,1,1

three:
data 1,1,1
data 0,0,1
data 1,1,1
data 0,0,1
data 1,1,1

four:
data 1,0,1
data 1,0,1
data 1,1,1
data 0,0,1
data 0,0,1

five:
data 1,1,1
data 1,0,0
data 1,1,1
data 0,0,1
data 1,1,1

six:
data 1,1,1
data 1,0,0
data 1,1,1
data 1,0,1
data 1,1,1

seven:
data 1,1,1
data 0,0,1
data 0,0,1
data 0,0,1
data 0,0,1

eight:
data 1,1,1
data 1,0,1
data 1,1,1
data 1,0,1
data 1,1,1

nine:
data 1,1,1
data 1,0,1
data 1,1,1
data 0,0,1
data 0,0,1


Back to top
Zimnox Find user on ICQ Send AIM user a message
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 22nd Jan 2007 18:29           | link | toggle

Quote: "So who's judging this one since you're entering this challenge that you've set?"

I will be judging it just to get the ball rolling, but as I said in an earlier post, my entry won't be included. I just entered for fun.

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Lucifer

User


Joined: Mon Dec 26th 2005
Location: Iceland
Posted: 23rd Jan 2007 18:35           | link | toggle

Phaelax, holy cow, that clock is nice!


i like pancakes..
Back to top
Report this message as abusive
NanoGamez guy

User


Joined: Sat Jan 13th 2007
Location: Closer than you think...
Posted: 24th Jan 2007 12:51           | link | toggle

I'm not entering but I've got an idea for someone to do, which is 'a melted but working clock' I hope somebody uses this idea because I'd really like to see it.

living is my first priority
Back to top
doorstep.site90
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 25th Jan 2007 07:40           | link | toggle

Just a reminder that the challenge ends tonight at midnight GMT.

At the time of posting, that's just under 10 hours to go...

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 25th Jan 2007 18:36           | link | toggle

OK - time is up! No more entries.

I'll be taking a look at the entries shortly and will announce the winner and runner-up tomorrow.

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Phaelax

User


Joined: Wed Apr 16th 2003
Location: Ohio
Posted: 25th Jan 2007 18:50           | link | toggle

my clock says i got 4 more hours! oh well, i had nothing else anyway.

Back to top
Zimnox Find user on ICQ Send AIM user a message
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 26th Jan 2007 12:19           | link | toggle

Sorry - I made the 'time up' post at 12:30am GMT - 30 minutes after the deadline.

You are working to GMT right?

TDK_Man

PS: Results shortly...

Back to top
TDK\'s Web Site
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 26th Jan 2007 13:56           | link | toggle

OK - the reults...

I've basically marked according to the following criteria:

1. Imagination. Does it display the current time in an 'unusual way'?

2. Does it display the correct time?

3. Is it readable? How useful is a clock when you can't tell what time it is?

If more than one entry scores the same, as a tie-breaker I decided to judge the most visually pleasing as the winner.


Entries:

Sven - Spheres Clock.
Accurate, but conventional clock face. Very easy to read. Only loses a couple of points for lack of originality.

Lukas W - 3D clock.
A clock using a standard clock face but in 3D. Nice attempt, but unfortunately it didn't actually display the time, though Sven did fix it. Like Sven's entry, only loses a couple of points for being a standard clock face.

Latch - 1. Bouncing Cubes Clock.
Imaginitive and unusual idea. Accurate but not easy to read.

Latch - 2. Rotating Plains In Transparent Cubes Clock.
Also Imaginitive, unusual and accurate but a little harder to read - especially when the plains are at certain angles.

Latch - 3. Matrix Clock.
Very imaginitive and unusual idea - one which I would never have thought of. Accurate and easy to read too. With further work this could become a really nice screensaver.

Latch - 4. Robot Clock.
Not really a clock so difficult to mark. But it's unusual and tells you the time.

Phaleax - Drop Clock.

Digital Display made from blocks that jump into position from the bottom of the screen then drop down when not required. Easily read, accurate and novel idea, technically executed.

Conclusion:

Overall, the challenge was centred around making a clock as 'unusual' as possible so that had priority. The one I was most impressed with and scored highest therefore was:

+ Code Snippet
Latch - Matrix Clock


And a very close runner up was:

+ Code Snippet
Phaleax - Drop Clock


Congratulations to both of you and the winner must set the next challenge within the next 24 hours.

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Latch

User


Joined: Sun Jul 23rd 2006
Location: Cyberspace
Posted: 26th Jan 2007 16:15     Edited: 28th Jan 2007 02:01     | link | toggle

Thanks TDK_Man,

It's too bad only 4 people participated in the last challenge. I'm not sure of an idea for a challenge because I don't know if people will participate if they think it's too hard or too easy...

Even so:

[EDIT - new challenge ]

Draw with mouse on 2d screen

Make a program that uses the mouse to draw on a 2d screen. If the mouse is drawing a continuous stroke, there can be no breaks in the stroke no matter how fast the mouse is moved across the screen.

There should be the ability to change the pen colors and clear the screen with keyboard or additional mouse input.

Scores will be based on functionality, ease of use, and extra points for any kind of bells and whistles beyond the basic challenge parameters. For example, if you want to add something like clicking the right mouse button draws a circle, feel free to do so.

Since I changed the challenge because my original choice was a bit complicated, I'll extend the deadline to February 4th 2007 midnight GMT.


[OLD - challenge, no longer in effect]

DBC FLAME EFFECT CHALLENGE

The challenge will be to create a fire or flame effect in DBC. You can use 2d or 3d and the result can be anything from a flicker to a roaring blaze to a flame thrower or anything you can imagine.

Scoring will be based on scales from 1 to 10 in:

Coolness : how does it look?
subcat. to coolness
color
presentation
animation

Ingenuity

The total of the 3 catagories under Coolness will be totaled and that will be the coolness score. Coolness and inginuity will be added to provide the final score.

I'll set the deadline for 1 week from now at midnight GMT

Friday, February 2, 2007

Enjoy your day.
Back to top
Report this message as abusive
Phaelax

User


Joined: Wed Apr 16th 2003
Location: Ohio
Posted: 26th Jan 2007 19:47           | link | toggle

grrrrrr, I hate DBC! It's so primitive.

Without memblocks or any way to access pixel data directly in memory, this effect is just unbearably slow. We're talking about 0.4fps.

For those who don't want to wait forever to see how the effect looks, here's a link to my DBP version with a screenshot from my java version.

http://forum.thegamecreators.com/?m=forum_view&t=60719&b=6

+ Code Snippet
System_ScreenWidth = 320
System_ScreenHeight = 240

set display mode 320,240,32

dim fire(320,240)

rem controls height of flame value = [4,5]
flame# = 4.02

sync on


repeat

   for y = 1 to 239
      for x = 1 to 160
         fire(x,y) = newValue(x,y,flame#)
			ink fire(x,y), 0
         dot x,y
      next x
   next y

   for x = 1 to 160
      r = rnd(255)
      g = rnd(255)
      if g>r then g = r
      fire(x,240) = rgb(r,0,r)
		ink fire(x,y), 0
      dot x,240
   next x



   if upkey() then inc flame#, 0.02
   if downkey() then dec flame#, 0.02

   sync
until spacekey()



function newValue(x, y, flame#)
   c = getColor(x,y+1)
   r = rgbr(c)
   g = rgbg(c)
   b = rgbb(c)
   c = getColor(x-1,y+1)
   r = r + rgbr(c)
   g = g + rgbg(c)
   b = b + rgbb(c)
   c = getColor(x+1,y+1)
   r = r + rgbr(c)
   g = g + rgbg(c)
   b = b + rgbb(c)
   c = getColor(x,y+2)
   r = r + rgbr(c)
   g = g + rgbg(c)
   b = b + rgbb(c)

   r = r/flame#
   g = g/flame#
   b = b/flame#

   c = rgb(r,g,b)
endfunction c


rem safe way to retrieve value from array
function getColor(x, y)
   rem if index out of bounds
   if x < 1 or x > 320 or y < 1 or y > 240 then exitfunction rgb(0,0,0)
   v = fire(x,y)
endfunction v


Back to top
Zimnox Find user on ICQ Send AIM user a message
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 27th Jan 2007 08:15           | link | toggle

I'm OK with the challenge, but I do think it's a little on the difficult side for any newcomers who were thinking of joining in. This might scare them off before they've participated.

But if you want to stick with it, I'm OK...

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Lucifer

User


Joined: Mon Dec 26th 2005
Location: Iceland
Posted: 27th Jan 2007 08:55           | link | toggle

Quote: "but I do think it's a little on the difficult side for any newcomers who were thinking of joining in. This might scare them off before they've participated."

it does scare me but i think i have an idea on how to do something like this...


i like pancakes..
Back to top
Report this message as abusive
Latch

User


Joined: Sun Jul 23rd 2006
Location: Cyberspace
Posted: 27th Jan 2007 13:08           | link | toggle

Ok, how about this:

Make a program that uses the mouse to draw on a 2d screen. If the mouse is drawing a continuous stroke, there can be no breaks in the stroke no matter how fast the mouse is moved across the screen.

There should be the ability to change the pen colors and clear the screen with keyboard or additional mouse input.

Does this sound a little more reasonable as a DBC challenge?

Enjoy your day.
Back to top
Report this message as abusive

Go to the first page of this board Return to the Forum Menu Post Message
3,384 Messages - Page   of 85   
Search the Forum Next 40

This is a multi-page thread older than 30 days.
Go to the last page to check if you can reply to it.

Forum Search

Enter a word or phrase to search our Forum for:

Thread Subject Search
Search Phrase:
Search Scope: Entire forum
Just this board
 
Google Forum Search
Search Phrase:
 
Apollo v2.02


Game Creator Store
Privacy Policy AUP Top of Page