dop2000's Forum Posts

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

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

  • Tokenat() expression is perfect for this.

    s="100,Hello"

    Tokenat(s, 0, ",") will return "100"

    Tokenat(s, 1, ",") will return "Hello"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • First, you are confusing people and scaring them away telling that this is a multiplayer game. It's not. Multiplayer in C2 means playing with other people online.

    Your mistake is in Axis() expression. It takes two parameters - gamepad number and axis index.

    So for the second player you should use Axis(1, index)

  • "On step" condition is only available in Construct 3.

    In C2 you can try pinning a bigger (longer) invisible sprite to the bullet. Use it to check for collisions with enemies

  • on the other hand moveTo and tweening can be done with a couple of events. It's always better to use events and avoid potential problmes unless we are talking about a plugin that saves you a lot of time.

    I would love to see how you can replicate LiteTween functionality with a "couple of events"..

    These plugins are very popular for a reason. And if Scirra is not planning to include them into C3 by default, they should at least assist with rewriting them for the new runtime.