About | Rules and Guide | Sign In/Create Account | Write a Post
Construction1990’s Internet Montage? No!
Please excuse the site weirdness. Mike is fixing and making things.
Ludum Dare 31 — Coming December 5th-8th 2014!

  • ??? Begins: in 7 days, 23 hours, 9 minutes, 51 seconds
  • October Ends: in 8 days, 23 hours, 21 minutes, 51 seconds
  • Ludum Dare 31 begins: in 44 days, 0 hours, 9 minutes, 51 seconds
  • (FYI: Clock might be off) | Ludum Dare 31: Real World Gatherings (Now Open!)

    [ October Challenge 2014 | Resources | Submit/Edit | View All ]

    Html5 Base-App

    Posted by (twitter: @Nehmulos)
    December 9th, 2012 10:37 am

    This weekend I created the base that I’m going to use for the next Ludum Dare.
    It uses cocos2d-javascript for graphics, box2d.js for physics and a custom Audiomanager.

    If you want to get started with cocos2d-javascript, a look on my source code might be useful for you, since the tutorials are outdated.

    I have a custom PhysicsNode class that provides a simple constructor for box2d shapes and synchronizes a cocos2d graphics node with the box2d.body.

    Preloading images
    I modified cocos2d-javascript to allow simple resource preloading from javascript.
    Earlier versions required you to use the cocos2d commandline tool that merged all your files.
    Now you can just write this in your Application.js file:

    registerResource("images/myimage.png", "image/png");

    The custom Audiomanager first checks which codecs are supported,
    when you give it an audio file to preload it will use the first url for a supported format:

        "ogg": "audio/blub.ogg",
        "aac": "audio/conversions/blub.aac"

    Then you can play it with using the given alias


    The repository also contains a small bash script that converts all ogg files in the audio directory into aac and wav files using ffmepg.

    Please feel free to use this base for your own games.
    It’s licensed under the zlib license, which means: do WTF you want, just don’t claim, that you wrote code that was written by others.

    You can test it here.

    Tags: , , , , ,

    Leave a Reply

    You must be logged in to post a comment.

    All posts, images, and comments are owned by their creators.

    [cache: storing page]