Closed Thread Icon

Preserved Topic: Augut 20lines Javascript Contest - Save the Princess - entries (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=22761" title="Pages that link to Preserved Topic: Augut 20lines Javascript Contest - Save the Princess - entries (Page 1 of 1)" rel="nofollow" >Preserved Topic: Augut 20lines Javascript Contest - Save the Princess - entries <span class="small">(Page 1 of 1)</span>\

 
poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 08-01-2004 23:14

This month, the goal is to make a game in which we'll have to "Save the Princess".
You can make any kind of game : action, reflexion, rpg, rts, ...
The entries must be posted in this thread, the comments belongs to Augut 20lines Javascript Contest - Save the Princess - comments

quote:
a code monkey said once:
As usual, the main rule is to make your script in 20 lines of (effective) code.
Comas shouldn't be used to execute several instructions on the same line
See the code sample below to illustrate the basic rules :

code:
<script type="text/javascript">

/* */ document.body.onclick = function()
/* */ {
/* 01 */ val = prompt( 'enter a number' );
/* 02 */ for( i=0; i<10; i++ )
/* */ {
/* 03 */ alert( stupidFunction( val, i ) )
/* */ }
/* */ }

/* */ function stupidFunction( a, b )
/* */ {
/* 04 */ return a>b?a:b; // I said it was a stupid function
/* */ }

</script>



The document.body.onclick = function() does not count as a line as it's not some effective code and the function call could be put in the BODY tag ( or anyother HTML tag ).
The declaration of the stupidFunction() does not count either for the same reasons.
The coma in the line /* 03 */ is ok, since it simply separates the parameters of a function.


Hope we'll all have fun with this topic.



(Edited by poi on 08-01-2004 23:16)

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 08-02-2004 00:28

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

BillyRayPreachersSon
Nervous Wreck (II) Inmate

From: London
Insane since: Jul 2004

posted posted 08-03-2004 23:50

Woohoo... My first 20-line entry. It's pretty basic, but then again, it's only 20 lines long

http://www.soterm.com/dan/princess.html

The keyboard routine was liberated from poi's entry for last month... But imitation is the sincerest form of flattery, you know

It seems to work on most browsers, including Safari.

Enjoy those countless hours of watching the levels fly by

Dan

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 08-04-2004 17:44

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Scott
Bipolar (III) Inmate

From: schillmania.com
Insane since: Jul 2002

posted posted 08-11-2004 02:11

I got to 22 and then got bored, I must have lucked out and had the CPU always end up starting in a place close to the princess and not close enough to catch me in time.

(Edited by Scott on 08-11-2004 02:11)

shingebis
Obsessive-Compulsive (I) Inmate

From: UK
Insane since: Aug 2004

posted posted 08-15-2004 01:28

Here's mine:

Ant Invasion

(Note: PNG transparency required. IE not recommended...)

kastner
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Aug 2004

posted posted 08-24-2004 09:09

Hi, this is my first post, and first entry into a contest.
http://mine.metaatem.net/20_lines/princess/

I had a few questions - do If's count as lines - I counted mine, but if not I could REALLY use the 2 extra lines.

my "line" 4 is my board definition, and I kept whitespace in for readability, and to make adding boards easier... should I join all the lines?

I made the graphics in an older version of gimp, and didn't have the ability to output to gif, so they are transparent png's for now, until I can convince someone at work to convert them for me (don't have PS at home and I'm on vacation).
It *seems* to work on IE other then that, but I tested in mozilla during development. So IE, while looking like garbage, might be totally broken.

This was a LOT of fun. You really need to be clever when you can, and I'm hoping someone will tell me places I could optimize more.

There is also a "TODO" block in the source of known issues / enchancements I plan on making.

kastner
Obsessive-Compulsive (I) Inmate

From:
Insane since: Aug 2004

posted posted 08-24-2004 19:03

Switched to gifs, should render ok in IE now.

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 08-26-2004 17:03

* bump *

5 days left, and other entries are welcome.

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 09-01-2004 01:56

I started really late, so Prince of Persia ( pre alpha ) is all I manage to do this time. Sorry. I'll try to finish that script soon.

« BackwardsOnwards »

Show Forum Drop Down Menu