LittleStain's Recent Forum Activity

  • have a variable on the sprite, so on click the variable is added or subtracted.

    then have animation play on variable = 0, or 1

    add a wait function after. otherwise it can be prone to doing both actions on click

    on touch, sprite ___________ set variable =1

    sprite.variable = 0 _________ wait 0.2 seconds

    on touch, sprite ____________ set variable =0

    sprite.variable = 1 __________wait 0.2 seconds

    this should allow multiple instances of clicks too!

    It would be even easier to use a boolean variable and toggle it on tap..

    Or if you want to use a number

    on touch sprite - set variable1 = 1-variable1

    which would result in a toggle..

  • I wouldn't know if it is better, for I don't know your game and even what exactly it is you want to do..

    All I know is what you tell me..

    Arrays can be of great help in many situations, but if it is nescessary or even wanted in this case depends on so many things..

    If you want to learn about arrays, there are some great tutorials available..

    For now you are talking about buttons with animations (which don't exist, so I guess you are using sprites instead of buttons)

    You want to go from buy to equip, which you can do with a boolean (you could also do it without, depending on the difficulty of your setup)

    when pushed while displaying equip you want to change the animation of your ragdoll or parts of your ragdoll (if I understand correctly)

    I guess we are at the point where you should share a little bit more about how you have things set up before any further help will be what it should be, helpfull..

  • Thanks no luck yet.

    Dazzy

    Sorry, but without screenshots and/or the capx it's really impossible to be of any assistance..

    We don't have any way to see the problem and don't have any idea on how you have anything set up..

    Please try uploading what we need to see and providing a link to it..

  • I wouldn't do it that way because the second condition will allways be true right after the press, because C2 reads from top to bottom..

    Using an else event would be a much better solution..

    Regarding the action, what do you want to do?

    When you know what you want to do it's much easier to tell the computer..

  • Depends..

    do you want to use text, than you should use text

    etcetera..

    seeing you want to use an animation name, which I presume consists of text, text should be the right one..

    For something like a switch or something that is just yes or no / right or wrong a boolean is well suited

    num is for numbers as you probably understand..

  • switch?

    I don't have switch?

    Should I make one?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Question is in title

  • Ah.. there is more to the question..

    It might have been easier to know that before..

    Where are the buttons?

    In a menu or in the same layout as the ragdoll?

    I assume the name of the equipped animations should be stored in an instance variable on the right ragdoll part?

    Would using an array work?

    By the way..

    "what do u mean by (button boolean is Bought)??"

    create a new event

    choose the button

    choose "is boolean variable set"

    event made..

  • I guess I would use a boolean variable BOUGHT

    button boolean is Bought

    set animation to equipped

    else

    set animation to buy

    on button clicked

    set boolean bought : true

    Or is there something more specific going on here?

  • Really?

    This should work..

  • Found this link although I'm not sure it will work..

    https://teamtreehouse.com/community/fir ... -overrides

  • From the manual:

    https://www.scirra.com/manual/126/system-expressions

    zeropad(number, digits)

    Pad number out to a certain number of digits by adding zeroes in front of the number, then returning the result as a string. For example, zeropad(45, 5) returns the string "00045".

LittleStain's avatar

LittleStain

Member since 26 Apr, 2011

Twitter
LittleStain has 4 followers

Trophy Case

  • 15-Year Club
  • Email Verified

Progress

16/44
How to earn trophies