dop2000's Forum Posts

  • Ok.. If I understand you correctly, the first bullet kills the zombie. Then the zombie starts playing "Dead" animation. If you shoot again, the second bullet should fly through the zombie (not collide with it). Is this correct?

    You can disable collisions after the first bullet and disable Platform behavior for the zombie.

    Or you can check if animation "Dead" is playing on bullet collision:

    Bullet on collision with Zombie:

    and Zombie animation "Dead" NOT playing (right-click and invert this condition)

    ...Bullet destroy

    ...Zombie start "Dead" animation

    ...Zombie set collisions disabled

  • What is your native language?

    It may be easier to understand you if you use Google Translate.

  • Gamepad object has a few expressions, you can use them to check gamepad buttons and axes state in System-Compare values event.

    Gamepad.Button(Gamepad, Index)

    Gamepad.LastButton(Gamepad)

    Gamepad.Axis(Gamepad, Index)

    etc.

  • I need an effect like this:

    https://www.dropbox.com/s/fuvcgcj1qfrfz ... .capx?dl=0

    But the problem is, within 10 seconds as more particles are created, the FPS drops significantly, especially on mobile.

    Is there another way to make this random fog/smoke, which does not affect the performance?

  • You can use & and | operators to make this condition:

    System-> Compare two values -> ((x = 1 & y = 2) | (z = 3)) equals 1

    Of course if you need to compare things like "is overlapping" or "is mirrored", you can't use them in the formula.

    In this case you might need to add a local boolean variable and do something like this:

    Sprite1 overlapping A

    (and) Sprite2 overalpping B -> Set tempBoolean to 1

    tempBoolean=1

    OR Sprite3 overlapping C -> do things

  • Here is the formula to get the angle in 0-360 degrees range:

    a=(Player.8Direction.MovingAngle+360)%360

    If you want to have just one formula, I guess you can do something like this to get numeric value 0-3 for player direction:

    d = (a>315 | a<=45) ? 0 : (a>45 & a<=135) ? 1 : (a>135 & a<=225) ? 2 : 3

    Then set animation frame to d.

    Or you can name your animations "A0", "A1", "A2", "A3" and set animation to "A" & d

  • If your question is about organizing data, you can do this with multiple array instances.

    Create a separate instance of the inventory array for campfire, box, backpack etc.

    To know which each array instance is for, add an instance variable "InventoryType".

    Then insert as many elements as you need.

    Or you can make an array of arrays - "master" array that stores UIDs of all "secondary" arrays.

  • I don't think there is a better solution other than comparing the angles and changing animations.

    System-> Is between angles -> Character.8Direction.MovingAngle between -45 and 45 : Character set animation frame 0

    System-> Is between angles -> Character.8Direction.MovingAngle between 45 and 135 : Character set animation frame 1

    etc.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sprite -> On animation finished -> Sprite destroy

  • urkokan

    You do realize this post is 7 years old?

    Check out the Tutorials section, there are lots of examples for platfrormer games.

    https://www.scirra.com/tutorials/all

  • Add this sub-event under your event #4:

    Player1 is mirrored -> Bullet1 set angle of motion to 180

  • Hmm, you are right, and I was wrong.. Inverted "Green has LOS to Red" condition doesn't mean "pick all Green instances that don't see any Reds".

    It picks Green instances that don't have LOS to at least one Red instance.

    So, for example, if Green instance sees 10 out of 11 Red instances, it will still be picked by this event.

    Anyway, to avoid confusion I suggest using For Each:

    For each Green
       Green has LOS to Red -> Green set var to 1
       Else -> Green set var to 0
    [/code:utx5s1dm]
  • Actually, inverted condition should work too.

    You can do this:

    green has LOS to object -> set value to 1

    green has NO LOS to object (inverted condition) -> set value to 0

    The first event will pick all green instances that has LOS.

    The second event will pick all instanced that don't have LOS. (EDIT: this is wrong, see my next comment)

    Once you understand the concept of picking in Construct, it should all become much clearer.

  • "Else" in this case doesn't mean "all other instances that don't have LOS". If at least one instance has LOS, then the Else block will not be triggered.

    Assuming that you are setting the value 0/1 to an instance variable (not global), you can use "For Each", or you can set 0 to all instances first and then change it to 1 for instances that have LOS, like this:

    On every tick (or whatever other event) -> Green Set variable to 0
         If Green has LOS to Red -> Green Set variable to 1
    [/code:258ov9mq]
  • I've had this issue for months, just learned to live with it.

    And it's not only in sprite editor, in some other parts of the C2 software when you right-click, some options (that should be active) in the drop-down menu are greyed out but still clickable.

    I think this only happens on Windows 10.