R0J0hound's Forum Posts

  • In the case of that library here's the text to run that will load the library and run the example code from the libraries webpage.

    "$.getScript('NoSleep.js', function(){
    document.noSleep = new NoSleep();
    
    function enableNoSleep() {
      document.noSleep.enable();
      document.removeEventListener('touchstart', enableNoSleep, false);
    }
    
    document.addEventListener('touchstart', enableNoSleep, false);
    });"[/code:3ch80xxw]
  • Here are two posts that explain how picking works with created objects:

    It doesn't explicitly mention families but the created sprites aren't added to the family to be pickable until a top level event as well.

  • Wait is dt dependent so it won't work when timescale is 0. You could set the timescale of objects individually. Or you could use the wallclocktime expression to measure the time passed since it's not affected by timescale. Use wait signal instead of wait:

  • The action does exactly what it says, it executes some snippet of JavaScript. It's mostly useful for simple JavaScript stuff.

    It's not quite sufficient to easily use some JavaScript library. First, importing the library into the files folder isn't enough to make it usable. for that it needs to be loaded in one of three ways:

    1. Edit the exported HTML file and add the library with the other js files.

    2. Load it after the fact with the jquery.getScript function.

    3. Make a plugin and put the library in it's dependencies section of the edittime.js.

    One is a bit akward to use for testing, but it is the normal way to include JavaScript files in HTML.

    Two is slightly tricky since loading a library is asynchronous so the library can take time to load an may not be usable right away. The syntax is $.getScript(filename, callback) and callback is a function to call when the library is done loading. If you want examples of such a thing search my posts for JavaScript.

    Three is the reccomended way by making a plugin. Doing it with a plugin may make some things more straightforward than the other two methods.

    So then after you get the library loaded how you use the library depends on the library.

  • Why is it not intuitive? If you set the effect parameter before the wait it would be done then in the event.

  • Hmm. Maybe calculate the angle between the player and enemy with

    ang = angle(player.x,player.y,enemy.x,enemy.y)

    Then use an "angle is within" condition

    ang is within 90 degrees of wind.angle

    --- player is upwind

  • Make the wait the top action.

  • Global text foo="123456"

    System: compare variable foo=str(int(foo))

  • A few ideas:

    One would be to check if each character is a digit. You can extract indavidual characters with the mid() expression, and since you want to check each you'll want to use a loop. Use the Len() expression to get the number of characters. Next you either use a condition per digit or maybe use the find() expression to find the current character in some text of all the digits. Finally you could add 1 to a variable every time the character is a digit, then after the loop see if that variable is the same as the length of text.

    Another way would be to convert the text to an int then back to text and compare it with the original text.

  • When there's an error that causes a black screen the error is typically displayed on the browser's console. Seeing what the error is would be helpful to pinpoint what's causing it.

    It looks like google chrome can be used to debug and see the error console of a xdk/Cordova app running on a phone. I saw a tutorial in the tutorials section and another tutorial just with a Google search.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Dos box disables it with a winapi function and other games may do that too, but as I said it's not something that can be done from JavaScript.

  • I've always just manually disabled the shortcut from control panel.

    I guess there is a way to do it programmically using some Windows specific code, but that can't be done with JavaScript in a browser.

    It could possibly be done from an addon for a nwjs, but that doesn't seem like a very simple thing to do.

  • I think it's in the manual but you can by index

    Sprite.imagepointX(1)

    Or by name

    Sprite.imagepointX("myImagepoint")

  • The button object has its own "on clicked" condition. Maybe that's what you used before?

  • Yeah, it's relative to the top left of the canvas.