Switch Animations Randomly

0 favourites
  • 12 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • Im trying to switch between 2 animations randomly. I want the switch to take place when an Ememy is "on collision" or "overlapping" the Player character. I want it to choose randomly upon the "on collision" or "overlapping" condititions and continue to choose randomly so long as the conditions remaian true. The 2 aniamtions are not set to loop. They are a "kicking" animation and a "punching" animation. I hope this is clear.

    Thanks in advance.

  • +enemy: Is overlapping player
    +enemy: NOT Is animation "punch" playing
    +enemy: NOT Is animation "kick" playing
       -> enemy: Set animation to choose("punch", "kick")
    
    +enemy: On animation "punch" finished
    -or-
    +enemy: On animation "kick" finished
       -> enemy: Set animation to "idle"
    
  • sorry, but I really dont understand this example.

  • Here's a capx: randomKickPunch.capx (r105)

  • Didn't understand the choose. Very Cool. Thanks so much.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just curious, I wasn't aware you could use "choose". Is that a regular expression or is something unique to Construct 2? And can I find a reference other such statements?

  • Shinkan...REALLY!!???

    "Everything is in the manual"

    These types of responses are uncalled for and rude. New users to construct may not be familiar with different function terms that construct uses. Reading the manual will not help in every situation. Not only that, we share these forums with users from different language backgrounds, and terminology can become askew. If you can't simply answer a question... than don't. There have been many times when I have searched everywhere throughout this site for a for answers and only ended up lost and even more confused. If you insist that someone references the manual, then how about linking to the section in the manual or a specific place where the answer may lie. Sometimes I'm baffled by the arrogance of some of the forum users.

  • Thank you, for calling me rude. Appreciate that, I really do.

    Besides that saying (and giving link the same time - I know it's rude too) "Everything is in the manual" i was answering that question

    nd can I find a reference other such statements?

    and i meant that all available C2 expressions are explained in the manual.

    ...If you insist that someone references the manual, then how about linking to the section in the manual or a specific place where the answer may lie.

    I just did that in the link I post. :D

  • Well Shinkan,

    Perhaps you did not mean to be rude, but it did sound that way.

    "Everything is in the manual" sounds arrogant (whether or not you meant it), perhaps I would not have reacted so quickly if you had said something like... "you can find it here in the manual" or something similar. I'm not calling YOU rude, I just think the answer sounded rude.

  • Also there's a list of them under 'System' in the expressions window.

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/expressions.png" border="0" />

  • Thanks, the solution was very helpful and you did answer my questions...I took no offense, it didn't seem rude however, I appreciate it because I am new and I sometimes feel a little stupid with my questions and Im sure others do too. it's nice to know everyone is looking out.....Thanks again to everyone.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)