sysads's Forum Posts

  • Oh I didn't know that % represents a modulus calculation. Thanks

    Got 2 more challenge I would need your help with.

    1) I managed to create each level buttons but how do I center them all so for different phone sizes, it still centers everything

    img1

    2) In that tutorial, when you swipe, the screen slides slowly to stop but mine with the same configuration swipes and stops immediately, so no slowdown movement. This has to do with the "On DragDrop drop" block

  • I have followed your explanation but stuck somewhere.

    I started with loopindex = 1 so the calculation should be

    1%4 = 0.04 approximately 0

    0 * 300 = 0

    so X = 0

    but when I display what x is to a text, it shows 300px which is confusing me.

  • Thanks man. Any tutorial that explains this so I can read up on it.

  • Thanks for the info. Meanwhile can anyone explain what this values mean actually. been cracking my brain to understand what they mean:

    (loopindex%4)*300

    (loopindex/4)*200

    Thanks

  • I have searched for tutorials online on how to auto create level buttons with star features but most I have seen are vertical and don't scroll.

    img1

    img2

    As seen some buttons are hidden under.

    In landscape, I need to be able to scroll from right to left and vice versa

  • Without the while loop, it works but I need to stop the loop so I added the While Loop and it does not work.

    The wait function appears to causing some issues because when I remove it, the while loop works but its too fast.

  • I have tried your suggestion but stuck with one issue. I created 3 functions each to play different sounds.

    Func_1 - Play sound 1

    Func_2 - Play sound 2

    Func_3 - Play sound 3

    On button click AND system for Array.At(arrcount) from 1 to 5 - xxxx

    I am stuck here on how to call the correct func using this "Func_"&"Array.CurValue"

  • The function is to play a sound.

    I have a function that has 3 sub-events

    Each sub event is checking for the value of the global variable called buttonclicked. So if buttonclicked = the first array value 2, then it plays a sound I need it to play.

    So I expect it to play sound 2, followed by sound 3 etc.

  • Ah I see what you mean. So how do I tell the loop to wait for the first loop to finish before the second etc?

  • Array in debug mode

    I just replaced the values 2,1,3 with 2,4,6

  • I am adding the values like this for a test.

  • I did try that at first but in debug mode, the array shows you this:

    Data: 2,0,0

    instead of 2,1,3

  • I have created a set of array values as follows:

    Array","parameters":{"x":"0","y":"0","value":"2"}

    Array","parameters":{"x":"0","y":"1","value":"1"}

    Array","parameters":{"x":"0","y":"2","value":"3"}

    I want to loop through each values "2,1,3) on the click of a button so each values is used in a global variable.

    On button click

    For unknown reason, this only picks the first value which is 2 and ignores the rest 1,3.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes I know that but feeding the values is where I could not understand. What I have just done now is this as a test:

    Set Array object values as follows: Width = 1, Height = 1, Depth = 3

    On start of layout: set array value at 0 to "2,1,3"

    So in debug mode you see this in array: Data 0 = 2,1,3,0,0

    When I click the button, it only plays the value 2 and ignores the rest values.

    So it looks like doing "2,1,3" is seen as one value rather than 3 separate values.

    How do i insert more than 1 value in the array so it should look like 2,1,3 rather than 2,1,3,0,0

  • How do you set the value in the call function as suggested

    Call OnButtonClicked(X)

    Call OnButtonClicked(Y)

    Call OnButtonClicked(Z)