Sunday Jan 05, 2014

Phaser and NetBeans IDE (Part 2)

More fun with Phaser.

And here's the code:

var game = new Phaser.Game(800, 270, Phaser.AUTO, '', {preload: preload, create: create, update: update});
function preload() {
    game.load.image('sky', 'assets/sky.png');
    game.load.spritesheet('cat', 'assets/runningcat.png', 512, 256, 8);
function create() {
    game.add.sprite(0, 0, 'sky');
    player = game.add.sprite(40, 0, 'cat');
    cursors = game.input.keyboard.createCursorKeys();
    player.animations.add('walk');'walk', 5, true);
function update() {
    if (cursors.right.isDown) {'run', 70, false);
    else  {'walk', 5, true);

Two (silent) YouTube movies with NetBeans and Phaser:


Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« January 2014 »