Initialising Script Files

Two issues of the code from what I can see:

            forceZ += this.speed;
        }

App is no longer a global variable in the new scripting system IIRC. Change this (and other lines to):

        if (pc.app.keyboard.isPressed(pc.KEY_DOWN)) {
            forceZ += this.speed;
        }

Tutorials on input will help more in how some of this works: http://developer.playcanvas.com/en/tutorials/?tags=input

You don’t have this.force defined in the script. So you will need to define this in the initialize function of the script similar to how the old scripting system did on the constructor.

Movement.prototype.initialize = function() {        
    this.force = new pc.Vec3();
}

Refer to the user manual on scripts for more information: http://developer.playcanvas.com/en/user-manual/scripting/anatomy/

The new scripting system assigns the entity automatically when it gets created at runtime.