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:
// Continuously scroll this PixelSprite to the left by 4 pixels per frame
Which allowed me to create the following demo in around 20 lines of code:
[swfobj src=”http://sandbox.photonstorm.com/pbscrolldemo.swf” width=”640″ height=”400″]
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.
3 ResponsesLeave a comment
Make yourself heard
All about Photon Storm and our
HTML5 game development services
Filter our Content
- Cool Links
- Flash Game Dev Tips
- Game Development
- Geek Shopping
- In the Media
- Phaser 3