Design Problem: More Animations or More Actors?

techmaster90

  • Posts: 26
Hello I looked at the webpage that talks about "Design Problem: More Animations or More Actors?" but I didn't find this helpful. I want to add more animation combinations to my actor. For example I want my actor to run left... but that means I need to use the left key, but this left key is also used to walk left.  My question is how do I use the same key "left" in both cases to make character either walk or run left.  I attached the code I have so far but I can't figure it out.

« Last Edit: November 18, 2019, 06:30:04 pm by techmaster90 »

techmaster90

  • Posts: 26
I updated the code I'm using. But I still can't figure this out. Does anyone know how to do what I'm trying to do? I've been watching several videos and reading different pages on the forum but nothing is this specific about what I'm trying to do. Or I'm just not reading correctly. I'm basically trying to do a run movement when I press Right arrow + Z on the keyboard. But I also have a walk movement when I press the same Right Arrow key.

Luyren

  • *
  • Posts: 2778
You can set a boolean to true if the run key is held or not. Based on that boolean, you change the maximum speed your can move horizontaly, and change to the walking or running animation on your movement code.

I have a resource pack with a platforming movement behavior that covers this. You can get it here. Either use it as is, or study it to see one way to do it.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

techmaster90

  • Posts: 26
You can set a boolean to true if the run key is held or not. Based on that boolean, you change the maximum speed your can move horizontaly, and change to the walking or running animation on your movement code.

I have a resource pack with a platforming movement behavior that covers this. You can get it here. Either use it as is, or study it to see one way to do it.

Thank you!