Ubanita

GCP Next 2016 Demo

On March 23, Q42 and Google Amsterdam organized an event to watch the keynote from the GCP Next 2016 conference held in San Fransico.

As the Ubanita platform is hosted on the Google Cloud Platform, we were given the opportunity by Q42 to talk about our platform as part of a lightning talk. Ofourse, we had prepared a demo game and the audience was invited to join a simple multiplayer game.

2016 - together, we celebrate

This short (2 min) video was created using a simple interactive Ubanita script that translated touch events into Triangle generation. See below the interesting part of that program.

For each touchMove event, a random colored Triangle sprite is added. For each touchEnd event, such Triangles are created with a outwards radial velocity.

// touchMove is called when the game detects a movement in a touch
function touchMove(event) {
        var dus = {};
        dust.x = event.data.x;
        dust.y = event.data.y;
        dust.fill = randomColor();
        dust.radius = 12;
        dust.vx = _.random(-20, 20);
        dust.vy = _.random(-20, 20);
        _addTriangle(0, dust)
    }
    // when a player moves a (single) touch then call this function
_on("touchMove", touchMove);

// touchEnd is called when the game no longer detects a touch
function touchEnd(event) {
    var dus = {};
    dust.fill = randomColor();
    dust.radius = 4;
    for (var e = 0; e < 360; e += 5) {
        var rad = Math.PI * e / 180.0
        var cx = Math.cos(rad)
        var cy = Math.sin(rad)

        dust.x = event.data.x + (5 * cx);
        dust.y = event.data.y + (5 * cy);

        dust.vx = 200 * cx
        dust.vy = 200 * cy
        _addTriangle(0, dust)
    }
}

Kimtato, a simple physics playground

Kimtato is the name of a simple interactive demo that runs on the Ubanita platform. It is a playground of physical objects which are created by players using touch gestures on the controller. Once created, the objects can be pushed around using the two-finger gesture, we call edge input mode.

The following will discuss the making of this demo using the Ubanita Script API.

get dimensions

To position objects on the 2D scene, it can be useful to known the actual dimensions of that scene. The scene has two properties for the width (pixels) and height respectively. Using this snippet, we assign those property values to global variables W and H.