How do I And condition?

Get help using Construct 2

Post » Sun Nov 08, 2015 8:09 am

is there in construct 2 an AND condition?
i want to combine two keyboard keys into certain action,how?
please answer me! T_T
Last edited by adamu on Sun Nov 08, 2015 8:19 am, edited 1 time in total.
B
5
Posts: 48
Reputation: 339

Post » Sun Nov 08, 2015 8:19 am

adding a second condition is the same.
first condition is true then move to second condition, is this (also) true then do actions.
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Sun Nov 08, 2015 8:20 am

sorry, but i didn't understood... :/
can you explain better?
what condition to add?
Last edited by adamu on Sun Nov 08, 2015 8:24 am, edited 1 time in total.
B
5
Posts: 48
Reputation: 339

Post » Sun Nov 08, 2015 8:24 am

also (from manual - https://www.scirra.com/manual/78/expressions )

& can also be used as logical AND, and | is a logical OR operator. These are useful combined with the comparison operators, e.g. score < 0 | health < 0, which also return 1 if true and 0 if false.

?: is a conditional operator, which allows you to test conditions in expressions. This is especially useful when used with the comparison operators and logical operators. It takes the form condition ? result_if_true : result_if_false
e.g. health < 0 | score < 0 ? "Game over!" : "Keep going!".
The condition counts as true if it is non-zero, and false if it is zero.

edit - I will try to put together a capx...
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Sun Nov 08, 2015 8:25 am

i want to make key down and key left to be pressed in the same time then do an animation action.. how?
B
5
Posts: 48
Reputation: 339

Post » Sun Nov 08, 2015 8:40 am

This is all covered in the manual and tutorials, especially:

How Events Work.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
86
Posts: 5,487
Reputation: 59,760

Post » Sun Nov 08, 2015 8:41 am

Image

So in your case in the actions you would just set up your required animation.

Also see:-
https://www.scirra.com/manual/75/how-events-work
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Sun Nov 08, 2015 11:27 am

I have a problem with animations.
I want the player to crawl but when I press the down button or combine the left and down keypress it gets stuck in the 1st frame and no animation.
My request is this:
The player when keypress down it will go crawling but no animation.
Otherwise when the keypress combined like down+left or down+right it crawl and the animation plays.
Can you help me?
B
5
Posts: 48
Reputation: 339

Post » Sun Nov 08, 2015 11:39 am

You would speed up the help process considerably if you uploaded your .capx. That way, we can see what you've done and offer suggestions - or fix for you - any issues you may have.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
86
Posts: 5,487
Reputation: 59,760

Post » Sun Nov 08, 2015 11:43 am

I really want to but not enough reputation points.... :(

so i will show you a image..

Image
B
5
Posts: 48
Reputation: 339

Next

Return to How do I....?

Who is online

Users browsing this forum: ome6a1717 and 15 guests