mutajon's Recent Forum Activity

  • I'm creating a grid of tiles (the size of the grid and tile can change), and a randomly sized rectangle.

    The rectangle is always some multiplication of the tile size - for example: 3 tiles X 4 tiles etc...

    The rectangle is draggable, and I need it to behave in the following way:

    1. Always stay within the grid boundaries

    2. Move along the grid lines

    - I've sorta managed to do number 1, although there's a very jittery behavior near the edges - if anyone can help with that it would be GREAT!

    - I ripped nearly all my not-so-thick hair trying futilely to get the second behavior to work - no matter what I try, I only manage to get the rectangle to be dragged by tile-sized increments, but it is never aligned with the grid itself... and worse, this misalignment changes as one changes the screen size!

    PLEASE - help me keep what little hair I have left...

    The project file

  • dop2000

    Thanks! and how do I reference elements using scripting?

  • So I'm struggling a bit with how to make versatile functions by passing them different information types.

    For example, consider the following function:

    updateNumberAndText(x,y,z)

    step 1: add y to global parameter x

    step 2: update text element z to display the value of x

    I know how to pass the y value by using a local numerical variable, but how do I pass which global parameter (x) to change? and how do I then pass which text element (z) to update?

    (Clarification: I want to be able to change x and z every time I call the function from within the game)

    Thanks! :-)

  • Thanks for the very informative reply.

    Now I feel like I understand the wait concept much better.

  • dop2000

    from your explanation:

    Wait 0.5s

    Add 1 to variable

    Add 1 to variable

    Add 1 to variable

    Add 1 to variable

    Add 1 to variable

    Add 1 to variable

    Add 1 to variable

    Add 1 to variable

    Add 1 to variable

    Add 1 to variable

    I see that the wait is executed only once, at the start, while the add action is repeated 10 times...

    How does your trick fix this? Also, how does your trick not increase the wait time between steps the more times the loop is executed?

    Also, thanks for taking the time and effort to explain! :)

  • Ashley

    So that I'll understand better when and why to use the wait action, could you please elaborate why it is executed only once when it is a part of a loop? Why do I need to use the 'trick' dop2000 suggested instead of using the regular wait action?

    Thanks!

  • dop2000 Thanks! your solution worked:)

    Ashley

    but I get the same behavior even when I put the wait BEFORE the other actions (see pic)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So I'm trying to achieve the following behavior:

    -subtract 1 from variable X

    -update text that displays variable X's value

    -wait 0.5

    repeat the above steps for Y times. when I enter any value of Y (e.g.27) the behavior I get is a one-step subtraction of Y from X (instead of subtracting 1 each time, until Y-worth of 1's have been subtracted).

    I get the exact same behavior when using 'repeat' instead of 'for'.

    Can one not use 'wait' inside loops? If so, how to achieve desired behavior?

    can anyone shed light?

    Thanks! :)

  • So I've set an instance Boolean to be changed on mouse click, but it always becomes inactive (conditions referring to it do not trigger) and in the variable screen the Boolean designation is crossed out (see pic).

    What's going on?

    Thanks!

  • Thanks!

  • So I have a coin and the following logic:

    if coin overlaps tile (which it does in the attached example), wait 2.5sec and flash coin for 1 sec.

    What I get:

    system waits 2.5 sec, then sets the coin visibility to false...

    What's going on here? What am I missing?

    Thanks a ton!

    the file:

    we.tl/t-CaiiolyJZw

  • So I have an array of integers, and I want to make sure no two numbers within the array are the same.

    If they are the same, change one of them to something else and run the check for duplicates again (until there are no duplicate numbers).

    Any ideas on how to implement that?

    Thanks a ton! :-)

mutajon's avatar

mutajon

Member since 2 Oct, 2020

None one is following mutajon yet!

Trophy Case

  • 5-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

7/44
How to earn trophies