How do I And condition?

0 favourites
From the Asset Store
Publish and Subscribe to events in event sheets and from the scripting interface
  • is there in construct 2 an AND condition?

    i want to combine two keyboard keys into certain action,how?

    please answer me! T_T

  • adding a second condition is the same.

    first condition is true then move to second condition, is this (also) true then do actions.

  • sorry, but i didn't understood... :/

    can you explain better?

    what condition to add?

  • 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...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i want to make key down and key left to be pressed in the same time then do an animation action.. how?

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

    How Events Work.

  • 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

  • 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?

  • 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.

  • I really want to but not enough reputation points....

    so i will show you a image..

  • adamu

    You can bypass the posting restriction by just inserting a space or two in the url, such as:

    ht tp: www. mygame/ishere.com/mygame.capx[/code:3ills6up]
  • I might be wrong but it seems that event #6 cancels the animation you trigger on event #7.

    You can give the player an instance variable "crouch" and switch between states: 0=none, 1=standing_crouch, 2=moving_crouch and depending on the state trigger the equivalent animation.

  • can you explain how to do this variable?

    i have created a variable in the player object..

    how to do next?

    and i'm new to construct 2...

    thanks!

    i have checked the manual but none helped...

  • the capx file is here!

    h t t p ://www .filedropper .com / mygame_1

  • adamu

    Is this what you are after? (uses latest stable r216 from link at bottom of this page).

    https://dl.dropboxusercontent.com/u/34306693/mygame.capx

    Some advice: You maybe should look at doing a couple of the Platform tutorials, as the way you have chosen to do your Events is not really the best way.

    Also, your memory use is already a bit large due to the massive textures you are using.

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