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.

The 20 Line Challenge / [DBPRO] Win the lottery, the gamer's way

Author
Message
Kelebrindae
20
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 3rd Mar 2006 08:49 Edited at: 6th Mar 2006 09:22
Hi,
Here's my entry for the March 20-lines challenge:
Do you want to win the lottery and get rich, but don't know which numbers to choose? Don't cry no more, my gamer friend.
Play my little game, retrieve your familiar feelings (defend your base alone against an overwhelming threat, blah, blah, blah...), and at the end of the game, the program will gave you a set of numbers. Not an ordinary set of random numbers, though: your lucky numbers, determined by the way you played the game. Cool, uh ?

20 code-packed lines, forced-timing, no media, heaps of comments, and a few neat functions to create asteroids, to make a "legacy digital clock" display, an easy life bar, etc..

20-lines version:


And the "uncompressed" version, for an easier understanding:


I usually play it in 800x600 windowed mode, but you can have it your way, I guess.
Have fun!
(And tell me if you find some bug...)

[EDIT 03/05/2006]
I've found a bug in the definition of the crosshairs: with some GPU (Geforce 2 MX), the crosshairs were all white, instead of being of same color of the asteroids. I've replaced the "set object ambience" with a "set object diffuse" and it seems to work. Please tell me if it doesn't work for you...)

[EDIT 03/06/2006]
Another bug fixed (man, it becomes embarrassing... ). At restart, asteroids' vertical speed wasn't reset to zero, so when they were going up (that happens when you loose immediatly after catching an asteroid), they hit the grid from under.
Please get the new code; I hope it's the last fix (thought I know there's never such thing as a "last fix" in coding... )

Ideas: memories of things which did not occur yet...
http://keleb.free.fr/codecorner
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 3rd Mar 2006 11:12
hi

I'm probably being dumb but I couldn't work out the controls other than the mouse.

COuld you give a little more explanation please.

thanks

BM

Our aim is to keep the loo's clean, your aim can help.
Kelebrindae
20
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 3rd Mar 2006 14:31
@Big Man
Oh yes, sorry, I guess it's a little confusing.

Be reassured, my british friend, you're not dumb: there's no other control.
You don't have to shoot at the asteroids; you have to catch them. Just move your ship right on the crosshairs so the asteroids don't hit the grid.
There's a longer explanation at the beginning of the comments, as well as a scenario - Yep, there's one!
I've pasted an extract in the code section below:


Have fun!

Ideas: memories of things which did not occur yet...
http://keleb.free.fr/codecorner
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 3rd Mar 2006 17:37
thanks

Our aim is to keep the loo's clean, your aim can help.
Crazy Ninja
18
Years of Service
User Offline
Joined: 27th Aug 2005
Location: Awesometon
Posted: 4th Mar 2006 12:46
any chance of their being an exe made?
zzz
18
Years of Service
User Offline
Joined: 13th Nov 2005
Location: Sweden
Posted: 4th Mar 2006 15:03
This was really fun Kelebrindae!
I think I found a bug but I´m not sure, the asteroid-things doesn´t always hit the cross.

Kelebrindae
20
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 5th Mar 2006 15:33 Edited at: 6th Mar 2006 09:08
I've just fixed a bug with the crosshairs' color. Please download the latest version (up in the first post).
And on my PC, the particles don't show when I compile the code in "windowed-desktop" mode . In Fullscreen exclusive or windowed mode, the EXE runs fine...

@Cagel
yes, I think I can put the EXE somewhere (10,3Mo). Give me a little time and I'll post a link.

@zzz
Thanks!
I'll take a look at the bug you report. But it's strange, the crosshairs' and the asteroids' X and Z positions are determined by the same variables; they should be strictly identical . Could you elaborate ? Did anyone else notice the same behaviour ?

Ideas: memories of things which did not occur yet...
http://keleb.free.fr/codecorner
Kelebrindae
20
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 6th Mar 2006 09:25
Another bug fix. Please see first post. Sorry.
(need more )

Ideas: memories of things which did not occur yet...
http://keleb.free.fr/codecorner
Kelebrindae
20
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 8th Mar 2006 09:53
@Cagel
At last, I've uploaded an EXE at the following location:
http://keleb.free.fr/codecorner/asteroids-en.htm

I hope you'll like it!

Ideas: memories of things which did not occur yet...
http://keleb.free.fr/codecorner
Black Mesa
18
Years of Service
User Offline
Joined: 25th Mar 2006
Location:
Posted: 26th Mar 2006 06:21
Is it normal for it to not compile if you copy the code snippit from here in DBP?
Kelebrindae
20
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 27th Mar 2006 08:10
@black mesa5:
I've just tried with 2 different PCs, and it compiles perfectly in DBP.
- What sort of error do you get?
- Did you try the 2 versions of the code (20 lines and "uncompressed")?
- What version of DBP do you use ? (I've got DBP 5.9; I can't guarantee the code will work in 5.8 or 6.0b)

Can anyone else tell me if they have the same problem ?

Ideas: memories of things which did not occur yet...
http://keleb.free.fr/codecorner
Sergey K
20
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 8th Apr 2006 18:45 Edited at: 8th Apr 2006 18:52
@Kelebrindae: you need to read the rules.. your code is illegal.


Quote: "1) A line is defined as a line of text, terminated with a carriage return.
2) You can stack multiple commands per line up to a maximum of 25 commands per line.
3) External media is allowed but must be supplied for download or your post will be deleted.
4) External media cannot be larger than 200k in size UNCOMPRESSED.
5) State in the subject or body of the post if it's a DB or DBPro program (or both)
6) Lines with comments (remarks) on are not included in the 20 line maximum and are encouraged to help others understand your code
7) You are free to use blank lines to space out your code for readability, they are not included in the 20 line maximum. The second a line has a command on it it's included."


MyNewSite:http://gogetax.com
Forums(About BLO and more):http://gogetax.com/forum
Jedi Lord
19
Years of Service
User Offline
Joined: 11th Jun 2004
Location: Jedi Temple
Posted: 9th Apr 2006 01:34 Edited at: 9th Apr 2006 01:35
WHAT ARE YOU TALKING ABOUT?
HE HAVE 19 CODE LINES!!!
CAN'T YOU COUNT?

Whoa... I like a shiny thing...
Kelebrindae
20
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 10th Apr 2006 12:22
@Gogetax:
I'm sorry, but I don't see what you mean. There's 19 lines of maximum 25 commands each (some are less).
I've checked this result by counting the number of ":" in each line; there should be no more than 24 of them. Using this method, you'd notice the 15th line has 25 ":" and thus think it counts 26 commands, but it's only because there's a ":" in a text string.

But obviously, I can be wrong. So, could you please elaborate a little and tell me why you think my code is "illegal" ?

@Jedi Lord:
Wow, man. The way you jumped into the fight to protect the innocent (or should I say "the not-proven-guilty-yet"), that's very "light-side"; Obi-wan would be proud.
Thanks a lot for your support!

Ideas: memories of things which did not occur yet...
http://keleb.free.fr/codecorner
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 23rd Apr 2006 22:00
Pretty fun game, with an original idea!


Login to post a reply

Server time is: 2024-03-29 01:52:42
Your offset time is: 2024-03-29 01:52:42