makotto's Recent Forum Activity

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

  • Or assign one spritefont object per word, and create an on trigger condition based on some instance variable of the spritefont object.

  • Okay, seems that at some point you are adding the money the player earns in the event to the total money the player has. The way you describe it now, it seems more as a small bug. Try to figure out when are you adding the money earned to the total or post a capx so we can help figure it out.

  • You can use the "random" expression to create a random number:

    for example random(10) will generate a floating point random number between 0 to 9 (0.5, 2.0, 7.87, etc.)

    if you want only integers use floor( random(N) ) this will generate random integers between 0 to (N-1)

    if you need to convert those to text (string) use the str() expression:

    str( floor( random(10) ) )

  • Construct2 does not know what your variables names stand for. It is up to you to give them meaning.

    For a software a variable called MaxSpeed and another called Playerlifes are basically the same, just 2 variables that store numbers. Variable names are useful for you, the programmer, to remember how are you going to use them

  • My bad Sol. Never done it with same objects and same names.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Construct2 does not allow you to copy and paste events from different Capx projects. It may sound time consuming, but including the function object, and having a separate events sheet only for common functions has worked for me.

    You won't be able to copy+paste the event sheet, but at least it is easier to duplicate your functions.

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