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

Get help using Construct 2

Post » Fri Jun 14, 2013 11:57 pm

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
B
11
S
3
Posts: 25
Reputation: 1,306

Post » Sat Jun 15, 2013 12:33 am

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.

B
15
S
2
G
2
Posts: 23
Reputation: 1,751

Post » Sat Jun 15, 2013 12:36 am

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.
B
15
S
2
G
2
Posts: 23
Reputation: 1,751

Post » Sat Jun 15, 2013 12:52 am

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
B
11
S
3
Posts: 25
Reputation: 1,306

Post » Sat Jun 15, 2013 12:59 am

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!
B
11
S
3
Posts: 25
Reputation: 1,306

Post » Sat Jun 15, 2013 1:10 am

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.
B
15
S
2
G
2
Posts: 23
Reputation: 1,751

Post » Sat Jun 15, 2013 1:20 am

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
B
11
S
3
Posts: 25
Reputation: 1,306

Post » Sat Jun 15, 2013 1:20 pm

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.
B
15
S
2
G
2
Posts: 23
Reputation: 1,751


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests