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
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 20th May 2009 06:33 Edited at: 20th May 2009 06:51
interesting thoughts razer, and thank you

im totally baffled, i can see NO reason why this isnt working, i have a function that i have used DOZENS of times before with no problems but for some reason this program gives me an error when I call it



any ideas?

ok now im even more baffled, I tried it in pro to see wat happened and all i had to do was put a 0 after my endfunction and it worked THERE but back in DBC it gives the same error



There are only 10 kinds of people in the world, those who understand binary and those who dont
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th May 2009 07:01
SmartGuy:

nice. although when it hit's the side the feet keep counting.

New Site! Check it out \/
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 20th May 2009 07:12
thats the idea, its not a side, its made to make it LOOK like it keeps going with the camera stuck moving at the same rate as the ball, but it doesnt work well, ill fix that l8r

There are only 10 kinds of people in the world, those who understand binary and those who dont
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th May 2009 07:21
Ok well the grass was plain green so you cann't tell it's moving hahahaha sorry

New Site! Check it out \/
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 20th May 2009 07:52
i know, like i said i plan to fix that.... somehow.... hmmmm...

There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 20th May 2009 20:44
MAN DBC is WEIRD, it make ZERO sense why this worked, but i tried rearranging my math for the mouseover function, so that it multiplies the half of the width/height of the text as it puts it into the variable intead of during the function call and it works!!!

im still improving stuff so v2 isnt ready yet but i just wanted to let u all know i fixed it

There are only 10 kinds of people in the world, those who understand binary and those who dont
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th May 2009 22:14
The first part, if you didn't have exitfunction 0 and you assigned the function to a value in the program:

if mouseover(x1,y1,x2,y2) = 1 blah blah

you'll get an error because there is no return value from the function.

The second part, you are passing INTEGER values to the function : x1 y1 x2 y2

In DBC, function parameters use STRICT data types and will not accept any other data type except what is assigned to the function. You have



which is in error because you are converting the parameters to float values with the -.5 and * .5

Enjoy your day.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 20th May 2009 22:43
OK that makes sense, since i had txtwdt and txtht as INTEGERS it put the value to an integer, making it work

also i think u had a typo there, dont u mean ENDFUNCTION 0, I gathered that wen i tried it in pro and it gave me an error that tipped me off to that problem

There are only 10 kinds of people in the world, those who understand binary and those who dont
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th May 2009 22:56
yup, it's a typo. I meant endfunction 0

Enjoy your day.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 20th May 2009 22:58
thanks for the info, so i couldve just used int() to turn those parameters into integers, interesting

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 20th May 2009 23:08
Quote: "i couldve just used int() to turn those parameters into integers, interesting"


Or you could do one of these things:


Don't remember the function name but thats the idea. Instead of using INT, you could just use an integer variable and set it to the float value, to save resources.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 21st May 2009 02:09
heres v2 of my game, changes include:

the addition of difficulty levels

physics changes based on the difficulty level:

ball drops faster if on higher difficulty

not sure how accurate this is but the higher the difficulty, the more air resistance you encounter, sorta like wind but it can only slow the ball, not move it backwards


a better "endless field" effect, using only one variable believe it or not



There are only 10 kinds of people in the world, those who understand binary and those who dont
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 21st May 2009 04:23
Really impressive Smartguy. A power option would put the icing on the cake. Additionally, a simple add on of highest score would be nice.

Whos judging?


Time is money. I just ripped you off.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 21st May 2009 04:26
since this was a group vote on the challenge, lets make it a group vote on the winner

and yes I plan to add those and more to the game, notice i said v2, im not close to done yet

I have plenty of time, the challenge was made like 2 days ago and it goes for 3 weeks, so its not like im in a hurry to code this

There are only 10 kinds of people in the world, those who understand binary and those who dont
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 21st May 2009 04:52
I know, just giving a little input.

I vote the last two days of the competition are for voting.

That was a very democratic sentence. ;P


Time is money. I just ripped you off.
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 21st May 2009 05:49
Smartguy,
With the power system you could add more of a rolling effect,that would be cool.

If at first you don't succeed-Pause-Go to last checkpoint
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 21st May 2009 06:40 Edited at: 21st May 2009 06:47
i got the power system to work, and I even got a trampoline system to work (YAY!!!), im workin on fixin a bug causing the endless field effect (the thing that traps the ball at 550 pixels) to trigger before the ball gets that far, once I get that fixed ill put up a v3

[edit]
as i was typing that i realized the problem, lol

heres v3, letme know if you see any bugs, ill squash em!!



sorry for lack of remming, im just one of those people who can find anything in a pile of clutter, so ive never had a problem with not enough organization

There are only 10 kinds of people in the world, those who understand binary and those who dont
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 21st May 2009 06:57 Edited at: 21st May 2009 07:03
Quote: "center text 320,240,"Watch is amazement as the ball flies through the air based on your aim"
"


should be


and you get a NEW HIGH SCORE every time you beat your last throw.

"trampoline" thing is awsome it brings a goal to the game.

edit

my high high score is 4170

If at first you don't succeed-Pause-Go to last checkpoint
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 21st May 2009 07:00 Edited at: 21st May 2009 07:32
thanks for that, and ya new high score means new best distance for this round, I guess ill reword that

I would add the old fashion high score board into this, but u cant have external media in the challenges and I think arrays qualify as external media

ok i went and edited out a few small bugs, and one major one, the high score was overwritten every run so it gave you the new high score message every time you beat your LAST score, its fixed now though

heres v3.1:



There are only 10 kinds of people in the world, those who understand binary and those who dont
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 21st May 2009 16:58
@Smartguy
I think saved arrays are allowed if they are internally created.
I think the whole point of that rule was so people can just copy and paste the code and it will run.

There is an eight letter word. You can insert a letter into it or remove a letter from it without changing its meaning. Answer
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 22nd May 2009 05:56
7890 on easy
ya highscore system would be cool

If at first you don't succeed-Pause-Go to last checkpoint
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 22nd May 2009 05:59
ill think about it, btw i got 15,000 on easy once, lots of luck tho

There are only 10 kinds of people in the world, those who understand binary and those who dont
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 22nd May 2009 06:07
How would highscores work? you can't have external files?

New Site! Check it out \/
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 22nd May 2009 06:09
as obese or some1 said on the previuos page, you can have em as long as they're created in the code, so you only have to copy-paste the code into the editor and run it, no file saving required

There are only 10 kinds of people in the world, those who understand binary and those who dont
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 22nd May 2009 07:43
Smartguy,
Why do you use real# numbers in your code for speed and distance?
db just rounds it to the closest rational number(i think)

If at first you don't succeed-Pause-Go to last checkpoint
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 22nd May 2009 18:27
very true, when I draw stuff like the circle then it rounds it off

Im not really sure if using them affects anything, but in my head it seems like having forward# and up# be integers would change decrease the length and height of the bounces

im not sure if that would happen, but I cant see it making a drastic difference so I just went with floats

There are only 10 kinds of people in the world, those who understand binary and those who dont
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 22nd May 2009 19:53 Edited at: 22nd May 2009 19:56
the only thing i can think of it being useful is when you need to
mutiply: 4.4*4.4 it'll be 19.36 instead of 16.And when you need to
get a percentage% with a varible.like if the varible#=4.0 then
varible#*.01 and that times another varible like 2 would be 4% of 2

If at first you don't succeed-Pause-Go to last checkpoint
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 23rd May 2009 02:39 Edited at: 23rd May 2009 02:40
right, but I really cant see it having a major effect on the game, but to be as accurate as possible I went with floats

also my game is ADDICTING!!! I find myself playing it for no reason other than to beat my high scores

There are only 10 kinds of people in the world, those who understand binary and those who dont
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 23rd May 2009 04:46
Haha,

Well for my entry i'm going to try and do a little fetch type of game, hope i can get it in in time lol i'm not great with physics so idk.

sounds kinda boring to play but sounds like fun to code.

New Site! Check it out \/
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 23rd May 2009 05:05
im considering trying to adapt this game into 3d, not sure if I will or not tho

There are only 10 kinds of people in the world, those who understand binary and those who dont
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 24th May 2009 22:05 Edited at: 24th May 2009 22:15
I'm ready to heat up the competition. It's not quite what you would expect when you hear "flinging competition" but this is my take.

It's a spin on my ninja game. I took the code, pulled it apart, and adapted it to this. I made a few changes, including allowing you to jump once, and just finished a decent projectile system (press right alt, I have to add in left alt). It fires "throwing knives" the higher your "range level" (not set yet) the faster you can throw them. Additionally, maximum distance thrown shall soon be allowed.

I'm working on adding it NPCs for the player to kill and get experience. We'll see how that works out. I want to make this into a pretty awesome full RPG, so this is just a little sample, in case I don't finish in time (SAT and Summer Vacation is coming up). In hopes of beating SmartGuy, here's my first entry:


Please don't cry about the lack of commenting and the indentation.

EDIT:
Version posted was missing a return at the end. Should work now.


Time is money. I just ripped you off.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 25th May 2009 04:38
kinda different, not sure if it qualifies as a physics game though

There are only 10 kinds of people in the world, those who understand binary and those who dont
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 25th May 2009 04:55
The challenge wasn't physics.

It was flinging.

Projectiles.

Missiles.


Time is money. I just ripped you off.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 25th May 2009 05:51
u sure? I specifically remember the word physics being used, but watevr, the game isnt done yet (i assume) so we'll work on defining the challenge wen we get down to voting on a winner

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 25th May 2009 06:09 Edited at: 25th May 2009 06:48
I am working on my entry, when is the deadline?

[edit]
Got the first mode working.
Here is the code



So far only mode 1 is complete

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 25th May 2009 07:36 Edited at: 25th May 2009 07:39
@BN2
GLITCH!!!(I think)
When i played the precision one I found that if you put 1 for your

length and then put double of your goal it will get 99% accurracy

alot.I don't know if that will be a problem in the final version.

(Your code looks really complicated,I like it)

If at first you don't succeed-Pause-Go to last checkpoint
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 25th May 2009 07:41
im not understanding how to play, mind running thru stuff?

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 25th May 2009 08:01
The idea is that you are trying to fling a massless ball a given distance using a catapult system. A Weight of mass 1 kg (not really important) is placed on the counter balance side. The way you manipulate the firing is by adjusting the lengths of the different sides. If you want it to go farther, you make the projectile side longer than the counter balance side. I did have to fiddle with some of the math to make it reasonable, so if you guys are physics majors and can follow the math, sorry, it probably won't work out well in real life.

It has been kinda glitchy here and there, I am still trying to lock all of them down.

For instance, I got a -266.66% accuracy because the goal distance was 6 and I shot 28. Go figure.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 26th May 2009 08:37 Edited at: 26th May 2009 08:37
heres my code for the contest so far.I don't know if I'll be able to

do anything with it.Ideas are welcome.(keep them simple)

Still needs alot of work.


If at first you don't succeed-Pause-Go to last checkpoint
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 26th May 2009 08:40
is it supposed to do anything?

There are only 10 kinds of people in the world, those who understand binary and those who dont
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 26th May 2009 08:43 Edited at: 26th May 2009 08:46
Quote: "heres my code for the contest so far.I don't know if I'll be able to do anything with it."


no,(other than make a ball bounce around)I just made it 20 min ago.

If at first you don't succeed-Pause-Go to last checkpoint
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 26th May 2009 08:46 Edited at: 26th May 2009 08:48
it bounces?

[edit]
o, interesting

There are only 10 kinds of people in the world, those who understand binary and those who dont
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 26th May 2009 08:47 Edited at: 26th May 2009 08:47
o sorry click on the ball and throw it.

If at first you don't succeed-Pause-Go to last checkpoint
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 26th May 2009 08:49
thats definetly a start, U have plenty of time to work on it, challenge still has like 2+ weeks left

There are only 10 kinds of people in the world, those who understand binary and those who dont
NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 26th May 2009 19:42
Hello everybody! There's some really good entries for this challenge.

That1Smart Guy: Great physics and a good idea having trampolines and difficulty level.
Irojo: The game looks very neat and when you put in enemies it'll be a really good game.
BN2: You seem to have gone all out on the maths! I like the accurate physics, although sometimes it is a bit glitchy.
razerx: This is quite fun and would an awesome game. I love how simple and smooth the physics is, but I think that ball slows down too fast in the x dimension.

Here's my entry:



I went along the same lines as That1Smart Guy and BN2. You've got the fling the stick (by clicking) and try to get it as far as possible. The stick has got some blue rubber (or other bouncy material) which causes it to bounce higher when it lands on that side and also weighs it down.

The background mountains are generated with some perlin noise with my own texture generator for the rocks, and the trees are generated using L-system Fractals.

I have got a theory of why this challenge thread dwindled, it may be psychological. If not many people comment and praise when someone posts and entry, and the judge doesn't go through each entry in turn commenting on good and bad points, people might begin to feel demotivated and less likely to post entries.

Just a thought.


"There is no charge for awesomeness" - The Kung Fu Panda
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 26th May 2009 22:27
WOW!!!

thats almost overkill on the challenge, thats gona be tough to beat, but Im up for the challenge

There are only 10 kinds of people in the world, those who understand binary and those who dont
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 26th May 2009 22:41
A challenge battle? Nice! Lot's of cool stuff going on here!

Enjoy your day.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 26th May 2009 22:43
NO JOKe!!

There are only 10 kinds of people in the world, those who understand binary and those who dont
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 27th May 2009 00:06 Edited at: 27th May 2009 01:07
wow this is messy but could i change this to 3d so i can make the

camera follow the ball.

The only things i think i need to change are circle,get image,sprite


If at first you don't succeed-Pause-Go to last checkpoint
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 27th May 2009 01:17
NanoGamez:

Awesome but one thing, when you aim low then the "Projectile" gets pulled straight up anyway lol like a updraft or something

New Site! Check it out \/

Login to post a reply

Server time is: 2025-05-17 00:59:56
Your offset time is: 2025-05-17 00:59:56