Posted by: pixelero | January 22, 2009

Flight 25

My entry for The 25-Line ActionScript Contest, candidate 008, a flight simulation over a terrain of perlinNoise.

25lines25lines

Awfully long lines of code in an extremely compressed form isn’t the easiest thing to read, so here’s a couple of tricks for tightening code I came up with:

instead of

addEventListener(Event.ENTER_FRAME, update);
function update(e:Event):void {
var i:int=1, j:int =2, ii:int =0;
...
}

you could write:

addEventListener(Event.ENTER_FRAME, function update(e:Event, i:int=1, j:int=2, ii:int=0):void {
} // defaults has to be const values, though

and how to set pixels of a BitmapData on a single line:

(bmd = new BitmapData(w,h,false)).setVector( new Rectangle(0, 0, bmd.width, bmd.height), Vector.<uint>([0xebe9da, 0xebe1db, 0xe9e9da,/* long list of uints for the pixel values */ 0x00]));

… I think I’ll later post the whole code in a longer and more readable version as soon as I get some comments written on that.

Currently (January 22, 6:38 pm) my entry seems the be at 3rd place, with 10 votes (12,12,10, …) – so let’s see, anything might happen ! Who wouldn’t mind CS4 for a birthday present ?

Edit (January 23, 2009 at 8:48 am): Looks So Very Promising ! ok, I’m trying to keep cool, anything might still happen !

Edit (January 28, 2009 at 10:15 am): O-oh, my entry was leading all the weekend, now it looks like 030 has taken some votes ahead … But hey โ€“ you still have time to vote if haven’t already !

Edit (February 1st, 2009): Well, new month, new ideas – or actually old, writing 008 I did come up with couple of more ideas, so let’s seeย  !

Advertisements

Responses

  1. I voted for your work ๐Ÿ™‚
    I think it’s absolutely brilliant. And the best from the list.

  2. I actually voted for your entry as I find it both cool looking and using some stuff I did not know of.
    I mean this vector thing. Will need to try and play with it ๐Ÿ™‚ And thirdly I can come in handy in a lot of other works ๐Ÿ™‚
    For example it reminds me of this http://vimeo.com/2094557

    Anyways good luck wining ๐Ÿ™‚

  3. Brilliant!

    I’ve always been obsessed with endless perlin noise terrains, I was gonna do one for the 25 lines contest but I could never beat this!

  4. This is a great demo. I’ve also been working on my own terrain generator these past few weeks – seems to be the flavour of the month at the moment ๐Ÿ™‚

  5. great job!
    i did a very primitive terrain generator for the previous 25lines contest (http://www.flashfuck.it/2008/11/30/my-entry-to-bit-101s-25-lines-competition/) but, hey…this really rocks! ๐Ÿ™‚

  6. […] https://pixelero.wordpress.com/2009/01/22/flight-25/ […]

  7. I still can’t believe that took only 25 lines!

  8. I had the same idea for December contest.
    But i didn’t want to use drawTriangles (i don’t know why, may be that was my mistake) and tried to use something like voxel but using DisplacementMap.

    But i ended up with Bottle Glass Mountains.

  9. You are the best!
    I`m your fan from today ๐Ÿ™‚

  10. Congrats Petri.

    This time I didnยดt manage to take part but in my point of view, your file is by far the most impressive one.

    So, CS4 is waiting… ๐Ÿ˜‰

    Cheers
    -frank

  11. That was so impressive man!

  12. You should put it up on wonderfl (with proper code formating :D)

  13. Great Work
    I voted for you

  14. I voted for you, even though I have my own entries in the finals! Nice work. Your entry deserves to win.

  15. Excellent stuff… despite the compressed nature of the code, this is a great example of making use of fp10’s Matrix3D, Utils3D etc…

  16. It was a tough decision, but I could sit and watch your 25 lines do their stuff all day! You got my vote, good luck!

  17. what a pity, petri.

    i really thought this time the most impressive entry, and not the one with the most ‘friends/supporters’ would win.

    in my point of view, your entry was the most advanced one by far…

    maybe they change their voting system in the future (hope so!)? ๐Ÿ˜‰

  18. […] Flight 25 ยซ Pixelero […]

  19. You mean pictures can be drawn using actionscript? You mean actionscript as in Flash?

  20. @Joy – Yep, generated terrain, here’s some links for further info:

    http://iquilezles.org/www/articles/terrainmarching/terrainmarching.htm

    http://www.subblue.com/blog/2009/3/7/tracing_a_terrain

    … and February’s entries for 25 lines, n:o 9’s ‘magic card trick’ is nice, on the second run I figured it out – but my vote went to n:o 10:
    http://www.25lines.com/?page_id=231

  21. hello as http://www.25lines.com/?page_id=231 not working it will be great if you publish source code here


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: