RSS
 

Archive for the ‘Games’ Category

‘Cut the Rope’ HTML5 JavaScript Preloader

Posted on Wednesday, February 29, 2012
29 Feb

Screenshot of Cut the Rope HTML5 Javascript web appDevelopers from the popular iPhone game Cut the Rope and a crack team of HTML5 gurus from PixelLab, have developed an awesome JavaScript version that runs inside most modern web browsers using JavaScript and a number of powerful HTML5 features such as canvas and media APIs. You can find out how they did it from the behind-the-scenes video they’ve posted.

One of the interesting snippets from the dev blog is that the group behind the creation of the app have released an open-source preloader for JavaScript apps called PxLoader. It supports some extremely useful features such as being able to load in your canvas images in groups, use progress bars, get callbacks when various groups have loaded and supports a plug-in architecture so you can load in sounds too. It’s released under a fairly liberal MIT license and the PxLoader source is available on GitHub.

Image loading in Groups

A good example is using it in an HTML5 game to load menu sprites before actual game sprites since you would want the menu to display and load first. PxLoader can also provide progress updates to many listeners and will scope the updates and statistics to only the set of “tags” a listener is interested in, a tag being the text name of that group.

// Delay each image and append the timestamp to prevent caching 
var baseUrl = 'http://thinkpixellab.com/pxloader/slowImage.php?delay=1time=' + new Date, 
    $log = $('#sample3-log').val(''), 
    $menuProgress = $('#sample3-menuProgress').text('0 / 50'), 
    $gameProgress = $('#sample3-gameProgress').text('0 / 50'), 
    $totalProgress = $('#sample3-totalProgress').text('0 / 100'), 
    loader = new PxLoader(); 
 
// Queue 50 images for each section 
var addImagesForTag = function(tag, $progress) { 
    for(var i=0; i < 50; i++) { 
        var imageUrl = baseUrl + '&i=' + i + '&tag=' + tag; 
            pxImage = new PxLoaderImage(imageUrl, tag); 
        pxImage.imageNumber = i + 1; 
        loader.add(pxImage); 
    } 
 
    // add a listener to update progress for the tag 
    loader.addProgressListener(function(e) { 
        $progress.text(e.completedCount + ' / ' + e.totalCount); 
    }, tag); // scope listener to the current tag only 
}; 
 
addImagesForTag('menu', $menuProgress); 
addImagesForTag('game', $gameProgress); 
 
// Listen to every event to update total progress 
loader.addProgressListener(function(e) { 
 
    // log which image completed 
    var line = ' Image ' + e.resource.imageNumber + 
        ' Loaded [' + e.resource.tags[0] + ']\r'; 
    $log.val($log.val() + line); 
 
    // scroll to the bottom of the log 
    $log.scrollTop($log[0].scrollHeight); 
 
    // the event provides stats on the number of completed items 
    $totalProgress.text(e.completedCount + ' / ' + e.totalCount); 
}); 
 
// Start downloading images for tags in prioritized order 
loader.start(['menu', 'game'])

You can play with a working example of the group image loading on the PxLoader homepage (Sample 3).

 

Jet-fuelled HTML5 in 3D

Posted on Tuesday, May 24, 2011
24 May

Using the power of WebGL and some JavaScript Chris Milk, the US music video producer and some smart friends of his at Google have created some impressive visuals that play in real-time within a web browser without needing any plugins. These stunning graphics use the next round of HTML5 features that are sweeping across browsers now.

Read the rest of this entry »

 

Pub Darts now with Facebook Support

Posted on Monday, November 15, 2010
15 Nov

Richard Warrender's photo in Pub DartsHey, just to let you know Pub Darts 1.2 is now up in the App Store.

The biggest feature this new version supports is Facebook integration. Yes thats right… you can now log in and pull a “friend’s” profile picture straight onto the dartboard ready to let off some steam. Mmm, now if only you could download and try it out for free… wait you can because I made it free for a short while!
Here’s the link for Pub Darts.

So what else is in this free update?
Well I’ll tell you. This is what some people have been begging me for…

  • Ability to refresh dartboard
    (You can now remove the tiny dart holes)
  • Dart sound effects
    (Satisfying thuds as a dart hits the board – woop!)
  • Bug fixes related to using camera and albums
    (Needed fixing particularly for large images)

Just in case you can’t find it, to access Facebook navigate to…
Settings > Boss Image > Camera > Grab From Facebook

Let me know what you’d like to see in the next update. Either in the comments or an email. Of course, you could always leave a really positive review if you enjoy it :D

 
2 Comments

Posted in Apps, Games, iPhone

 

Pub Darts now with Instructions!

Posted on Thursday, July 29, 2010
29 Jul

Pub Darts iconWhen I first launched Pub Darts last March, I got many great positive messages from people who love throwing darts at their boss’s picture! I also got much negative feedback from people who found the throwing mechanism difficult or not as intuitive as I thought it was. Therefore adding instructions to version 1.1 was very important to avoiding those 1 star reviews!

However due to work commitments it has had to sit on the back-burner but with the recent release of the iPhone 4, I couldn’t help but update Pub Darts with gorgeous high resolution artwork. I also managed to add in some instructions, make a new icon, fix a few bugs, allow games to save themselves when you quit and completely redo the shadows to be more ‘iPhone-like’. This free update can be grabbed immediately from your iPhone by updating in the App Store application.

More updates are coming soon. Feel free to suggest some features you’d like to see. If you’ve yet to experience Pub Darts on your iPhone, grab it for free now.

Pub Darts Screenshot Pub Darts Screenshot

 
 

iPhone App: Throw Darts at your Boss

Posted on Tuesday, March 31, 2009
31 Mar

Pub Darts screenshot Pub Darts screenshotHooray. My iPhone game, Pub Darts is in the App Store. It’s a slick dartboard game with the added bonus of being able snap your boss/greedy banker and throw darts at their image. Just don’t let them catch you ;-)

Buy it now for only £1.19 ($1.99). For a short time only it’s now completely free! Grab it now.