{"size": 646, "ext": "js", "max_stars_repo_path": "projects/Input/input_keyboard_move/Scripts/InputTest.js", "max_stars_repo_name": "oneseedfruit/qiciengine-examples", "max_stars_repo_stars_event_min_datetime": "2019-04-29T15:08:42.000Z", "max_stars_repo_stars_event_max_datetime": "2019-04-29T15:08:42.000Z", "max_issues_repo_path": "projects/Input/input_keyboard_move/Scripts/InputTest.js", "max_issues_repo_name": "oneseedfruit/qiciengine-examples", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "projects/Input/input_keyboard_move/Scripts/InputTest.js", "max_forks_repo_name": "oneseedfruit/qiciengine-examples", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.8461538462, "max_line_length": 82, "alphanum_fraction": 0.6238390093}
/**
 * @author weism
 * copyright 2015 Qcplay All Rights Reserved.
 */

var InputTest = qc.defineBehaviour('qc.demo.InputTest', qc.Behaviour, function() {
    this.image = null;
}, {
    image: qc.Serializer.NODE
});

InputTest.prototype.update = function() {
    if (this.game.input.isKeyDown(qc.Keyboard.LEFT)) {
        this.image.anchoredX -= 5;
    }
    if (this.game.input.isKeyDown(qc.Keyboard.RIGHT)) {
        this.image.anchoredX += 5;
    }
    if (this.game.input.isKeyDown(qc.Keyboard.UP)) {
        this.image.anchoredY -= 5;
    }
    if (this.game.input.isKeyDown(qc.Keyboard.DOWN)) {
        this.image.anchoredY += 5;
    }
};
