Skip to content


AS3 2d tilescroller source

view swf and source here.

I trimmed down some processes and stripped any excess so the classes included focus just on the tile scroller. In my previous post the movement was based upon the position of the sprite- here it’s based soley on keystrokes. It also utilizes some of my ImagesLoader classes.

The real meat is in the updateScroll method of the MapScrollLayer class. That handles all the update of bitmapdata to the gridded tiles, and redraw/scroll of the displayed bitmap.
One thing i found exciting was creating custom namespaces. If you take a peek at com.custard.as3.models.TileLayerMap, in the constructor it creates a 2d array based on the data type.

I had planned to make a fuller presentation with some tutorial-like explanations, but my time is pretty thin right now. If enough people are interested in that, i’d definitely get on top of it. A basic understanding of OOP may be needed to gather something from the code. i don’t really plan to go that much into it, but if you are a little rusty, unfamiliar with the concept, or want to learn more, Ben Stucki is going into that this month on his blog.

…also…

every time i go back home to my parents’, there’s some more boxes of ‘junk’ that have been sitting in the basement, stuck in some dark corner, since my room was turned into an office.
this past weekend i went through another said box, and pulled out this bounty!

game&watch

had forgotten all about these guys…

i’m waiting for the box that had my old etch-a-sketch animator gadget. man, i loved that thing.

Posted in AS3, Flash.


3 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Ryan Miller says

    It was cool to find your example. There seems to be so little in Flash, AS3 game examples out there. I know of Andre Michelle’s blog and that’s about it. If you know of any other examples out there, please share!

  2. John Mc says

    Nice Work!
    A tutorial would be great if you get a chance. Looking into action script at the moment.

  3. Nivek2 says

    hello !

    thanks for you source, i looked this and in large map (exemple : 960×540) it’s very slow … i’m searching for a solution, if you have any ideas, please keep me posted :)

    very good job ;)



Some HTML is OK

or, reply to this post via trackback.