dop2000's Forum Posts

  • If you remove the question from the array after displaying, you don't have to worry that the values in random_number can repeat!

    Here is an example:

    At first your array looks like this:

    Index 0 - "What is your name?"

    Index 1 - "What is your birth date?"

    Index 2 - "Do you have a pet?"

    Index 3 - "Do you like games?"

    You generate random_number=floor(random(array.width)) and it's 2.

    So you display the question from the array at index 2: "Do you have a pet?"

    Then you delete the record with index 2 from the array.

    After that your array contains these records:

    Index 0 - "What is your name?"

    Index 1 - "What is your birth date?"

    Index 2 - "Do you like games?"

    Then you generate random_number again and the result is 2 again!

    But it's not a problem , because this time the question at index 2 in the array is different! Now it's "Do you like games?"

    And then you remove the question with index 2 and can repeat this until you have no questions left in the array.

    Do you see what I mean?

  • I really doubt that this is a bug in C2 editor.

    Since you know now that the problem is with inst_show variable, add debug output (Browser-Log) to all events where it can be set to false or toggled.

    There may be lots of different reasons why you game behaves differently every time you run it (mistakes with local storage, for example), but it's impossible to tell without seeing your capx..

  • Sorry, I don't understand your problem.

    My idea was to add all questions to an array, then remove them one by one. This is to ensure that each question is displayed only once.

  • Are you previewing the same layout? If you are switching between different windows in C2 and then press F5, you may be running different layouts.

    So the problem is with two text objects missing? Run the game in Debug Mode, see if these objects exits, check their position, visibility, etc.

    Check if inst_Show variable is true, maybe it gets reset to false by some other event..

  • Sorry, I don't know.. I'm not a big specialist in JS.

    Are you saying you can't modify the JS file with that adsCompleted() function?

    I thought it was supposed to be user-defined function?

  • Another method is to create a family with Card sprite.

    Then you can refer to two instances of Card object in the same event:

    CardFamily overlapping Card:

    ...If Card is on layer 1

    ...If CardFamily on layer 1

  • Oh, sorry I didn't realize this post was in C3 forum.

    I think you should be able to use "c3_callFunction" to call back your C3 function.

    It could be something like this:

    In your JS file:
    adsCompleted = function() { 
            c3_callFunction("myAdsCompleted");
    }
    
    In the event sheet:
    Function "myAdsCompleted" -> Set variable gamePaused=1
    ....
    [/code:316tm13t]
    
    See an example in this comment:
    
    (as R0J0hound mentioned, you'll have to rename "c2_callFunction" to "c3_callFunction")
  • Tough luck..

  • This depends on how you made your grid.

    If you are using Tilemap, see SnapX(x) and SnapY(y) expressions.

    If your grid is a bunch of sprites, you can use "Pick nearest"

    Or use a formula like this:

    newX = round(Character.X/16) * 16

    newY = round(Character.Y/16) * 16

  • Is the arm and bow one sprite or several?

    It will be easier to help you if you share your capx.

  • You do not have permission to view this post

  • Yes, "Set angle=No" in Bullet properties.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would suggest MoveTo behavior:

    When all buttons on the keyboard are released, use MoveTo to move the character to the closest cell on the grid.

    You might want to set initial MoveTo speed to Character.8direction.speed.

  • NetOne, thanks for the explanation!

    I'm familiar with the x360ce software, but it doesn't work with html5 games.

    I found another generic Bluetooth gamepad, it's not that old (about 4 years), but it too has the same issue with the right stick.

    So now I have three different gamepads with the same problem...

    I tried RawAxis expression and it does read Right Stick Y position. Axis number is 5.

    So I'm still confused - whose fault is it that filtered input from the right stick doesn't work in Chrome?

    Is it because Scirra didn't implement dinput method, or because Chrome doesn't support it?

    STARTECHSTUDIOS, what gamepad model do you have?