Skip to content



What it is:

StarlingPunk is a framework built on top the Starling library designed to add structure and organization to your 2D games. It’s perfect for rapidly prototyping ideas and promotes code reuse between projects.

As you may have been able to tell from the name, StarlingPunk is heavily inspired by the popular FlashPunk framework, although its not a direct port.

Why StarlingPunk:

  • Easily encapsulate code into worlds and entities
  • Manages collections of entities based on assigned types
  • Fast and easy collision detection system
  • All the power of starling’s performance, sprite sheets, particles, mobile development

Why build this on top of Starling:

  • Best of both worlds allowing us to mix and match regular Starling code with FlashPunk like organization.
  • Fast Stage3D hardware accelerated graphics
  • Provides a familiar structure for Actionscript developers
  • Harness the power of the display-list; worlds and entities extend the Starling Sprite class meaning display objects can be nested within them
  • Pre-existing Starling code can easily be incorporated into the framework
  • Starling already does a ton of things right, sprite-sheet animation, events, dynamic resolutions
  • Tons of tools and extensions will already work, like sprite-manager and particles

Grab the framework on github now!

Check out the example Project:

Click the image to play the example game, the example was ported from this flixel tutorial

Planned future releases:

  • Integration with the box2D physics library
  • Helper class for the Ogmo level editor
  • Helper functions for sound effects
  • Component based behavior system sorta like Unity3D


Categories: Actionscript, Stage3D, Starling, StarlingPunk.

Comment Feed

41 Responses

  1. Hi there. Not sure you’ve heard of Axel before… but is it fair to say the only real difference is that this library can use Starling side-by-side to do other rendering tasks while at the same time benefiting from FlashPunk’esque classes?

  2. Well done! Flashpunk is a great game engine and a similar one powered by Starling is even better :)

  3. this is awesome, thanks

  4. Nice! I’m looking forward to starlingpunk integration with the box2D physics library!!!

  5. I think box2d is not the most modern (dirty code organisation and class name herite from c++ version of the lib ) and optimize physics engine you should take into next release… look at nape physics engine, it has better performance, and manage some very cool features as liquid, physic shape from bitmap …

    Congratulation to this greate project !

  6. Have you built tile maps?. Great job!!

    freddyJune 29, 2012 @ 12:05 pm
  7. Haven’t included tile map support yet but it’s definitely on the list

  8. Great new …
    Impatient to see tile map support too

  9. Hey. Great work, but there seems to be something definitely wrong with hit tests and the hit boundary. Although I can get it to change the width and the height, I cannot get it to change the rect’s origin, no matter what I try.

  10. can you be more specific on what the problem is… what methods are you having trouble with? Can you give me some steps to reproduce the bug, or send me your source code?

  11. Sure. Adding this to added( ), although it changes the hitBox drawing, it doesn’t change the hit bounds.

    var rec:Rectangle = this.getRect(this.x,this.y);
    rec.offset(this.height * .25, this.width * .5);
    rec.width = this.width – this.width/2;
    rec.height = this.height – this.height/2;
    this.hitBounds = rec;

    this.showHitBox(rec.x, rec.y);

  12. Also, shouldn’t there be a collide method without an x and a y? What exactly is that virtual x and y used for? What I’m assuming is that setting the hitbounds changes the hitbounds, but it doesn’t appear to do that. Also the fact that collide requires an x and y value leads me to believe there is something I’m not getting….As my entities have movieclip animation, some that requires ample transparent pixels, this is really problematic. Any help is greatly appreciated.

  13. Thanks for finding this, after looking into it there is indeed some funkiness with adjusting the offsets for a hitbox. The showHitBox method seems to be completely unreliable and I ended up taking it out. I’ll add it back once I figure out a more sane way of dealing with it. The most obvious problem was that the hitbox’s width and height was being ignored when colliding with any kind of Mask… so any tileset collision. I’ve fixed that and added some methods and properties from FlashPunk such as originX and originY that should make this sorta thing easier. Just pushed the new version to git hub so after downloading it this bit of code should do the trick:

    setHitWidth(width * .25);
    setHitHeight(height * .5);

    Get the new version here:

    Let me know if that works. Also you can think of the x and y properties of the collide method as “if the entity was at this x and this y would a collision happen” so collide(this.x + 30, this.y) would test any collisions that happened 30 pixels to the right of the entity.

  14. Nah, doesn’t work, sorry cant be more specific. This should work with movieclips no problems, right?

    What you told me to try assumes image is centered.

    Unfortunately, without show hotbox and it working, I’m gonna have to go with a pixel perfect method from forums.

  15. But I did find a very “low-rent” solution that fits my needs, although doesn’t speak highly of my elegance as a programmer. I’ll post here in a few days. I need to test more; if I forget, feel free to email me.

    Now, second issue, object pools. Apparently if I done call the remove method, I end up with excessive draw calls, if I do, then it removes the entity and disposes it, which defeats the purpose of an object pool. I’m thinking there needs to be a way to remove it without disposing.

    I have to say, though, this is good work on your part. I got bigger issues with Adobe and Android Touch lags and Kindle and Lost Context…nothing to do with your great addition though.

    James A. BrannanOctober 8, 2012 @ 8:29 pm
  16. That’s a good point I’ll look into the dispose flag. Although I’m thinking that if you recycle the entity back into the object pool flash will have a reference to it and therefore it will not be garbage collected even if the dispose flag is set.

  17. Thanks for implementing SPCamera in version 1.3! Looking forward to using it. Cheers.

    MurdochOctober 23, 2012 @ 4:21 pm
  18. Hi, although you have said it is not a port, can you tell me how close the api is to that of “FlashPunk”.

    Are there any features from “FlashPunk” that have not been included in “StarlingPunk”?

    The reason I ask is out of interest in porting older FlashPunk games, it would be great to use custom compiler options to toggle “Starling/Flash Punk”.


  19. The biggest difference from flashpunk is obviously the use of the Starling Framework. FlashPunk uses bitmap blitting to render everything and Starling uses stage3D. So some things like the camera class had to be completely rewritten. Additionally there are some “missing” features that I have yet to be implement in StarlingPunk for example FlashPunk’s console debug system. There’s also some things that will never get ported because they have become redundant… Starling already has an awesome tweening engine built in.

    So you’ll find the API very familiar but I doubt you’ll be able to export from FlashPunk to StarlingPunk without a good amount of work… although if you get it working that would be very cool :)

  20. Hey Andy. I’m kinda interested in using this framework. I like FlashPunk and I want to target iOS.

    I wish the FlashPunk forums weren’t down. :(

    Anyway, I was looking at the Entity class and noticed it doesn’t have a graphic variable. Instead, you just add display.image as a child. I was wondering, can you similarly add a DisplayObject to it?

    I want to use the library to procedurally draw stuff. If so, will the rest of the engine still work with it (collision)?

    Sorry if none of this sounds right. It’s been some time since I’ve used Flash and FlashPunk.

  21. @Rahil Glad you’re interested in the framework…. You are correct one of the big changes I made was removing the graphics class from FlashPunk. Instead the entire entity is a Starling Sprite displayObject. So yes, any starling display object can be added to an entity.

    Starling works a bit differently then the traditional flash display list and it really depends on what your trying to do in terms of procedural drawing. For simply things you can draw to a bitmap object then convert that to a Starling Image and add it to the entity. If you need to draw in real-time (updated every frame) you might want to look into the starling Grahics extension.

    In either case collision detection will work normally so no need to worry about that.

  22. Whoa interesting, thanks! Are you still working on the engine?

    The reason I ask is because I want to prototype and hopefully develop a lot of iOS games. I want to avoid Objective-c (Cocos2d), mainly because my games involve a lot of simple procedural drawing (draw a line between touch points) and I enjoy the simplicity of Flash’s drawing primitives. I also loved using FlashPunk; I made my first game with it. I will likely try this engine and Citrus, as it has the option to easily add physics and is current, although I’m a little afraid of the component-based structure.

    For now I’m hacking away at Unity which is currently displaying super blurry 2d sprites on my iPad.


  23. I’m not entirely sure if this is the best place to let anyone know about this but, I found this framework yesterday while researching Starling.

    I’ve been looking for a way to easily get animations from Spine into FlashPunk, with little success. When I stumbled upon this while googling I immediately gave this a go, very pleased with the way you implemented things.

    Due to the (awesome) change in how graphics for Entities are handled, I really easily implemented an extension of the SPEntity class that can load a Spine Animation as the Entity’s graphical display.

    It can be found here:

    It’s probably too specialised to be included in the actual engine but I thought I would let people from around here know.

    If you have no idea what Spine is:


  24. This is completely awesome great work. This is exactly why I decided to build off of starling so we can leverage and easily integrate all the awesome frameworks and tools that work with it.

  25. Incredible story there. What occurred after?

  26.   近日,从咸安农业局经作股传来消息,咸安围绕年初工作计划与目标,积极推进 期货网上开户 全区茶园基地快速发展,茶叶加工有序推进,茶叶市场稳步提升,全区茶产业呈现出良好的发展态势。  产量增加产值增幅  今年,区农业局成立了茶叶技术服务专家组,多次组织茶叶专家、技术员下乡入户。天公作美加之茶农精心管理茶园,使全区茶叶实现产量和产值”双增”。  根据全区18家茶企和40个种茶大户调查统计测算,今年全区茶叶产量达到1921吨,同比去年增加300吨,增幅18.2%。受今春雨水气候影响,全区春季名优茶总产为 314吨,与去年基本持平;夏茶1176吨(其中老青茶982吨),同比去年增产161吨,增幅15.7%;秋茶4

  27. Finally, you may get an absolutely original argumentative essay made by knowledgeable college essay author.

  28. Any update on this? :) Would be cool to see this project brought back to life.

    Buying a new or used automobile could be a challenging method if you do not know what you are actually doing. By teaching yourself about vehicle buying prior to visit the dealer, you may make points much easier for yourself. The following tips may help your upcoming purchasing getaway be pleasurable.

    Constantly bring a auto technician together when looking for a whole new automobile. Auto retailers are well known for promoting lemons and you may not desire to be their next patient. When you can not get a mechanic to think about cars with you, at least be sure that you have him take a look at final choice before you purchase it.

    Know your limits. Before you start buying for your next auto or truck, make a decision what you can afford to shell out, and follow it. Don’t forget to feature curiosity about your calculations. You are likely to spend all around twenty percent as a down payment also, so be prepared.

    Just before attending a dealership, know which kind of automobile you would like. Research all of you options prior to shopping to help you evaluate which works well with your finances and family requires. Do your homework to determine simply how much you should pay for a potential car.

    Before you sign any commitment spend some time to go through every line, such as the fine print. If you have something shown that you simply do not comprehend, tend not to indication up until you have an solution that you simply recognize. Unsavory salesmen may use a legal contract to insert a lot of fees which were not mentioned.

    When you keep the preceding guidance in mind when that you simply go shopping for a vehicle, you will certainly be prone to get a better offer. Getting a automobile does not have to become a head ache. Only use the ideas out of this article and you may get the auto you need with a very good value.

    Landsay87lFebruary 12, 2017 @ 6:41 pm
  30. Whoa! Tһis blog lоoks just likе my old οne! It’s on a totally ⅾifferent topic
    Ьut іt has pretty muϲh the same layout and design. Wonderful choice of colors!

  31. Amazing things here. I am very satisfied to see your article.
    Thank you so much and I’m lookin forward to contact you.

    Will you kindly drop me a e-mail?

  32. After going over a handful of the blog articles on your blog,
    I seriousy like your technique of blogging. I book marked it to
    myy bookmark websie list and will be checking back in the near
    future. Please check out my website as well and tell
    me how you feel.

Some HTML is OK

or, reply to this post via trackback.

Continuing the Discussion

  1. […] StarlingPunk – A framework built on top the Starling library designed to add structure and organization to your 2D games. […]

  2. […] on Share this:TwitterFacebookLike this:LikeBe the first to like […]

  3. […] Specifically, the StarlingPunk framework developed by our own Andy Saia for hardware-accelerated 2D […]

  4. […] with Ryan Wiemeyer and Michael Block. Andy Saia gave us an exciting run-down on his awesome-looking StarlingPunk framework, and Phil Tibitoski told us all about the new developer feedback service […]

  5. […] StarlingPunk – Radical Propositions. […]

  6. […] StarlingPunk – 将 Starling 和 FlashPunk 整合的游戏框架 […]

  7. […] StarlingPunk – A framework built on top the Starling library designed to add structure and organization to your 2D games. […]

  8. […] Flashpunk was much easier to use than the Starling framework.  I did start using something called StarlingPunk, a port of FlashPunk straight to Starling, but quickly ran into issues.  StarlingPunk didn’t […]