How to use the level.setCenterPosition function in level

To help you get started, we’ve selected a few level examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mattbasta / Legend-of-Adventure / www / modules / entities.js View on Github external
if ('width' in data) {
            data.width *= settings.tilesize;
        }

        if ('height' in data) {
            data.height *= settings.tilesize;
        }

        for (var key in data) {
            if (!data.hasOwnProperty(key)) continue;
            entity[key] = data[key];
        }

        if (follow === origin) {
            require('level').setCenterPosition();
        }

        draw(origin);
    });