Posts Tagged ‘scrolling’

  • PixelBlitz Engine Update: AutoScroll support with demo

    Just a small update to the PixelBlitz Engine today, but a pretty cool one!

    I’m creating an intense shoot-em-up game as my water shed test of the PB engine. Each day I get to add a few more features to PB that makes the game closer to reality. Once I have reached that point I know we’ll have something truly useful on our hands :)

    Today I added in a backdrop behind my ships and thought “damn, that ought to scroll” – but I figured that PB ought to handle the scrolling for me, automatically – just set it and forget it. So that is what I’ve added to the engine tonight.

    It’s a piece of piss to use:

    [as]
    // Continuously scroll this PixelSprite to the left by 4 pixels per frame
    pixelsprite.autoScroll(PixelSprite.SCROLL_LEFT, 4);
    [/as]

    Which allowed me to create the following demo in around 20 lines of code:

    I’m quite pleased with how this is shaping up :) You can autoscroll any PixelSprite, with full transparency preserved (so they can be overlaid on-top of other PixelSprites for true glass-window scrolling effects). The PB engine takes care of making the scroll seamless for you, and you can modify the speed on-the-fly (although I’d recommend not to do it every frame if you’ve got a lot going on).

    The only issue is that scaling an auto scrolling PixelSprite will mess it up, so I’ll need to remedy that.

    It’s now the weekend, but if i get some spare time I plan on continuing my task of fixing the left over issues before cracking on with collision groups and sprite mask tests.

    Here is the source + FLA.
    You’ll need to checkout latest revision (v21) of PixelBlitz from Google Code to compile it though.