makotto's Recent Forum Activity

  • You can use text variables to capture the sequences (one per sequence). Once clicked each button can append its value to the variable, e.g. On Button1 clicked -> Append "1" to SequenceVariable

    So, if a player makes the first sequence BTN4, BTN3 and then BTN2, BTN5 your SequenceVariable will be "4325"

    Once you have all the variables, sort them (this way "4325" will be sorted to "2345") and compare.

  • For any floating point number: random(2)

    If you only want integers floor( random(2) )

  • Disabling global gravity and applying downward forces is the way to go. Write some code to re-balance objects that rotate or receive other torque.

    If Sprite1 is NOT between -5 and 5 degrees --> set Sprite1.Angle to 0

    Also add values to the angular dampening and density of the object that may rotate, the higher the values, the less rotation you will see. Hope this helps.

  • We can do that, we just need to change the function a little bit.

    Here is the CAPX with the modified function:

    https://www.dropbox.com/s/tu2bhky5f5hjdhp/invertStringAndRegex.capx?dl=0

    Let me know if you have other questions.

  • Now, if you must have the functionality to remove each "@" one at a time, this gets more complicated.

    I couldn't find a good way to do it in the manual (based on the provided tools), so I wrote a little function to do it.

    Our ReverseRegexReplace function works this way:

      You pass a text to the function It inverts the text (by calling an "InvertText" function) It uses RegexReplace to get rid of the first "@" (which was the last on the original string) It inverts the string again (because inverting it twice restores the original order) Sets the text object to the String value.

    Here is the CAPX with the function implementation. It works, but it can be messy due to the nesting:

    https://www.dropbox.com/s/riemcuosi1z2i46/invertStringAndRegex.capx?dl=0

    If someone finds an easier way to do it, please share. If you have questions, let me know, hope this helps.

  • You can use: replace( Text1.text, "@", "")

    replace will find all the in Text1.text and will replace them with empty strings ( "" ).

  • You can use the function object to help you with this. Create a function called "Explosion" which takes the number of explosions as a parameter.

    On Function "Explosion"

    For Loop, repeat Function.Param(0) times -> play explosion animation -> play explosion sound

    if Function.Param(0) > 1 -> wait 1 second

    When the player clicks:

    on click -> Call Function "Explosion" with one parameter =1

    This will play the explosion one time

    At the end of layout -> Call Function "Explosion" with one parameter= 10

    This will make 10 explosions (and so on).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Maybe you can add a global text variable and set it to "FALSE" at the start of each level

    at Start of Layout -> set variable WIN to "FALSE"

    if Player bounces of ground -> set Win to "TRUE"

    if (any lose conditions) and WIN equals "FALSE" -> lose

    This way the losing events will only trigger if the player has not won the level yet.

  • You can use a loop to populate the values of an array. However, if your values do not have a logical relation to each other, that may be difficult

  • This is one way to do it:

    Add an instance variable to the items you will use as price.

    Each item has a different Integer value starting at zero (e.g. t-shirt=0, baseball cap=1, shoes=2, etc.)

    When the player inserts the token to play lottery use floor(random(n)) where n is the largest index

    do a for each loop for the prize item and pick the item whose instance variable matches the one chosen by floor(random(n)).

  • You can add the physics behavior to all the falling tiles, and set them to immovable (initially).

    After your player character collides with each tile, you change each tile involved in the collision to be movable.

    Check this example CAPX:

    https://www.dropbox.com/s/lppbeb06fqp1e88/physics%20boxes%20max%20speed.capx?dl=0

  • Check this example CAPX. Hopefully this helps.

    https://www.dropbox.com/s/lppbeb06fqp1e88/physics%20boxes%20max%20speed.capx?dl=0

makotto's avatar

makotto

Member since 29 Mar, 2013

None one is following makotto yet!

Connect with makotto

Trophy Case

  • 11-Year Club
  • RTFM Read the fabulous manual

Progress

12/44
How to earn trophies