makotto's Forum Posts

  • 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).

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Check this example CAPX. Hopefully this helps.

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

  • You can create a maximum speed variable and an event to prevent the object from going beyond the max speed.

    Constant Variable MaxSpeed = 30

    If [your object].velocity > MaxSpeed --> Set [your object].velocity to MaxSpeed

  • Or using #spacedoubt method:

    button is clicked

    random(100)<80 --> go to layout1

    else --> go to layout2

  • Your question is very generic. Please be more specific on the button's function.

  • Are you trying to change the value of the Sprite instance variable on a right mouse click?

  • Alternatively you do not need to shuffle the deck. just randomize the card drawn.

  • What structure are you using to hold the deck? An array?

    If so, you can randomize (shuffle) your array order, then pull the top half of the cards into one structure, and the rest to another structure.