Platform player crouch and shot problem

Get help using Construct 2

Post » Sat Dec 21, 2013 4:19 am

OK, i have make a plattformgame. Player can shot and i have use nummeric instance variables. is the player push left arrow the instance variables set for one and the player shot at the left side (included set bullet angle 180). when i push right arrow the instance varible set to 0, player shoot right. It works wonderful! But now, i have a big problem. When i crouch down (same variable) the player is crouch down left or right (its run), but when i shot he is stand up and shot the bullet to the normal line and not the deeper downline.... What can i make to kill this problem? Is there an example in the net?
Oh, when i have post this and another user have the same problem and have it post before.... give the link. I need an example for plattformer left right jump crouch and everytime player can shot the bullet at all the differnet positions....
THX for help
B
4
S
1
G
1
Posts: 65
Reputation: 788

Post » Sat Dec 21, 2013 4:25 am

If left arrow is down
    AND down arrow is down > shoot crouch anim left
    else > shoot standing anim left

If right arrow is down
    AND down arrow is down > shoot crouch anim right
    else > shoot standing anim right

If you're going to be doing a lot of this you can use other conditions such as when the character is doing a certain anim(standing, crouching etc) or when they are in a certain variable state. This is just because it gets messy when using logic with key presses when it gets more complex, I know from experience : P
plinkie2013-12-21 04:26:26
B
47
S
18
G
84
Posts: 2,271
Reputation: 49,796

Post » Sat Dec 21, 2013 5:07 am

Yeah thanks for the help.... but i have now an other question. is the "AND" two conditions or need it a an syntax-word? OK, its an amateur-Question... But i have for many years work with Multim.Fusion and the logical is often the same. What i mean is, i have some Tutorial not read and sometimes i have only a special-problem (for example: last post from me) ;)
B
4
S
1
G
1
Posts: 65
Reputation: 788

Post » Sat Dec 21, 2013 6:01 am

No problem, I know what you mean. Other engines etc have other ways of doing the same things! If you have left arrow is down event you can add two sub-events (press S) within left arrow is down. For sub-event 1 add the condition for down arrow is down and put in the logic, for sub-event 2 add the same condition but right click on it and select invert to set it to when down arrow is NOT down and put the relevant logic in there. If you require any more info then post again, someone will respond. GL!
B
47
S
18
G
84
Posts: 2,271
Reputation: 49,796

Post » Sat Dec 21, 2013 2:15 pm

Wow, you have rescure my weekend :D Very Thanks. Have big X-mas and Happy new Year!!!!!
Bye
B
4
S
1
G
1
Posts: 65
Reputation: 788


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests