1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.36 Bug Reporting thread
    Solutions and more information may already be available.

Some questions about app development

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by NaxNir, Mar 8, 2015.

  1. NaxNir

    NaxNir
    Expand Collapse

    Joined:
    Jan 28, 2014
    Messages:
    618
    Is it possible to have a variable that is the g-forces acting on the car. Is this right?
    Code:
    MyAppsName.prototype.update = function(streams){
        //convert to G
        var gForces = {};
        $.each(streams.sensors, function(index, val) {
            gForces[index] = val / 9.81;
        });
    and would the variable be: gForces


    The second question is how is it possible if that variable is greater than, say, 1 it will print out "Crashed"? Is this right?
    Code:
    if ('gForces' > 1) {
        $("<h1>Crashed</h1>").appendTo(this.rootElement);
    }
    and have it stay like that until the car is reset. I have a thing earlier in the app that will say "Alive" can I make it loop back to the begging once the car is reset.


    Sorry if this is in the wrong section, I wasn't really sure where to put it :confused:

    Edit: Please delete, as it has been moved to Questions-about-g-forces-and-UI-apps
     
    #1 NaxNir, Mar 8, 2015
    Last edited: Mar 21, 2015
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice