dop2000's Forum Posts

  • AJAX request project file

    On AJAX completed -> Dictionary load from AJAX.LastData

  • The question is too vague. You need to add a condition to "On key pressed" event, to check if the previous action has finished.

    .

    Here is a simple way to restrict pressing a key only once a second:

    Global Variable timer
    
    On "F" key pressed
    Compare variable timer<(time-1)
    ..... Set timer to time
    ..... (do the other stuff)
    
  • OP was not asking how to move objects on a grid. The question was about chess.js API - the correct syntax used to promote a pawn.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Also check these examples:

    howtoconstructdemos.com/category/virtual-joystick

  • There are two separate events on your screenshot.

    The second event has no conditions, that's why "Timer add dt" action is triggered on every tick.

    You need to move this action into the first event.

  • Create a family with the tile object. And use "For each Tile -> Tile is overlapping TileFamily"

  • Like I mentioned, it's not recommended to mix Physics with other movement behaviors (Platform, Solid, Pin, Bound to Layout and many others). This will most likely cause problems.

    So you need to remove Bound to Layout and instead build a barrier around your layout with immovable walls.

  • Please re-download the file:

    dropbox.com/s/p5787hpljwxwcjc/ChessJS.c3p

    Use string like b7-a8q to promote to a queen.

    In my example I'm calling .move method with 3 parameters - from, to, promotion. There is another way to use it, by passing a string in Standard Algebraic Notation (SAN). In this case to promote a pawn you'll need to run a script like this:

    chess.move('a8Q')

  • It uses Standard Algebraic Notation for moves. See this link:

    en.wikipedia.org/wiki/Algebraic_notation_(chess)

  • Simply add Physics behavior to the ball. Set Linear Damping to something like 0.5, to slow the ball down over time.

    Normally, using Physics + 8direction behaviors together is not recommended, but in this game it may be ok.

  • It's not clear what you mean. If the circle should move together with the block, you can simply pin it. Or create a physics joint.

    Or do you want the ball to move on itself and bounce off the block (like in Pong/Arkanoid game)?

    .

    Check out this demo:

    howtoconstructdemos.com/air-hockey-game-template-for-two-players

  • I believe audio files are moved to the root folder on export. If you want to move them back into Music folder after exporting, you can try using Audio Play (by name) action, for example:

    Audio Play "Music/Intro.mp3"

    But I am not sure if this will work, you need to test. Also, music will not play in preview.

  • Have you tried "Set stepping mode" action?

  • Try running the following script on start of your first layout:

    window.addEventListener('keydown', event => {
     if ([' '].includes(event.key)) {
     event.preventDefault();
     }
    });
    
    
  • Physics has its own collision detection system, which works differently.

    Besides, the ball object has rectangular collision polygon, and in physics properties you set Collision mask to Circle. So "On collision event" may happen before Physics behavior registers it.

    Try using this condition instead: ball.Physics.ContactCount>0