how to combine keys to start animation (how do i)

0 favourites
  • 8 posts
From the Asset Store
4 Block Soldiers with different animations, 400x400
  • a quick example of what i mean

    "space key down" sets animation to ground attack position: while space is held down

    space + a is ground attack 1

    space + s is ground attack 2

    space + d is ground attack 3

    on space released non of the ground attacks are possible unless space is down

    A, S, and D are separate animations the string off of space which is "ground attack position"

    problem is i cannot stop a s and d from starting those animations

    and i only want them to be possible if space key is down while pressing a s or d

  • This is quite easy to achieve, but tricky to get there once you're new.

    What you need is a Sub Event under the events where you press the A, S, D and the sub event to test if the Space bar is held down.

    <img src="http://i42.tinypic.com/ekki0h.png" border="0" />

  • Sorry for double post, but the main reason the function is calling out numbers is to add in to the word "Animation" so that it calls the corresponding animation in the sprite, which is called Animation2 and Animation3, but name them as you wish, in this case you can have GroundAttack2 or GroundAttack3 as the animations names in the sprite.

  • thanks for the help greatly appreciated ive gotten the general idea i was trying to have the space button make my player mount a downed enemy and hold it the then while holding space which is mounting the enemy it holds the enemy in place then pressing a or any key in general it sets the attack animation and injures the enemy after every attack is finished im a newbie in some case and im not fully understanding "function" i apologize for my ignorance lol

  • never mind i understand what you said now haha thanks alot man im also interested in a few people to help on my game i have a few in mind let me know if your interested and thanks again!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think I understand what you want here, but it's a bit more complex for me. Using features like Pin and fiddling with the angles of the objects can help you mount your character properly on the enemy when you press Space, disabling movement as long as you hold down Space.

    And the function is quite easily explained in tutorials, which is what you should try and read around. They pretty much do the same thing as you would do on an event, but it helps avoiding repeated actions as you could see in the picture above. Without the function, I would have the same actions for when I pressed the A and S keys, so making a Function and calling it was the best option to save space, and it also allows you to send some parameters like I did to decide which animation to use!

    Sorry if I didn't explain this very well, I am a newbie too afterall, but you should seriousley read the tutorials, this community is excelent in helping people, so I'm sure you will find a great tutorial laying around.

  • i agree tutorials are great im just hopping right into a game idea ive had for a few years now, i did i few like ghost shooter and platform so i know alot of the basics just great to ask people who can give me the answers im looking for instead of scraping threw tutorials and trying to implement there events into my own

  • Well, one of the rules they have here in the forums is that you should always try to do it yourself, so that when you ask for help you got a .capx to show people that you did try, rather than trying to make people do the work for you.

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