dop2000's Forum Posts

  • The first "Pick Adventurer where distance..." condition here is wrong. You haven't picked an enemy yet, so you are comparing distance to only one enemy instance (first instance with IID=0, which could be on the other end of the layout).

    I suggest you use "for each" loop:

    Adventurer state not equal "inCombat"
    For each Adventurer
     Enemy pick nearest to Adventurer
     System Is between values: distance(enemy.x, enemy.y, adventurer.x, adventurer.y) between 60 and 500
     ----> Adventurer set state "inCombat"
    

    .

    If you have lots (hundreds) of enemies and adventurers, calculating distances between them may be a bit slow. In this case you can use Line Of Sight behavior - it works faster than distance() expression.

  • On mouse click
    Ball NOT overlapping Wall at offset X:-20, Y:-20
    Ball NOT overlapping Wall at offset X:20, Y:20
     (all the sub-events here)
    

    Clicks will be ignored if ball is within 20 px of the wall on either side.

  • Would I be able to use break loop instead of the comparison, too?

    Yes, you can use "break" - add a sub-event in the loop, in this sub-event check if loopindex>1000, then break loop. But it's easier just to add this condition to the While loop itself.

    Also, since I'd like to have it happen on start of layout, cant this also be done in a single pass?

    You mean add two cells in one loop? Yes, it's possible:

  • You can add additional conditions to "On mouse click" event to ignore clicks when the ball is too close to the walls. One way of doing this is with inverted "overlapping at offset" event.

  • There are lots of behaviors that can move sprites. For your situation (move to a point, then stop), I recommend MoveTo addon.

    You can also move without any behaviors:

    On every tick
     Sprite compare Y > 0 : Sprite set Y to (Self.Y-100*dt)
    

    where "100" is the speed (pixels per second)

  • The same way you add all other objects - double-click empty space on the layout and select Touch from the list of available object types.

  • You can pin everything on this layer to some invisible sprite and then just move that sprite. Use families to decrease the number of events.

    There is also an addon called "Layer" by Rexrainbow that allows some layer transitions (fade, scale, rotate), but unfortunately you can't move the layer with it..

  • Set "Force own textture=Yes" on the layer.

    They move your rain sprite in front of the mask sprite and set "Source in" or "Source atop" blend mode on it.

    You can experiment with different blend modes, the important thing is "Force own textture=Yes" setting.

  • Yeah, you can do this with While:

  • I made some changes:

    dropbox.com/s/f5r5tcmm04pna27/BounceBall2.capx

    Bullet angle is unreliable, so I added BallAngle instance variable and changing it with events.

    Bullet angle of motion is set to BallAngle on every tick. "Bounce off solids" is now disabled.

  • Add Touch object to the project and manually replace all Mouse events/expressions with corresponding Touch events and expressions.

    After that you can delete Mouse from the project, Touch will work with both touch screen and physical mouse.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I noticed that when uploading an image, file extension should be in lowercase. "Image.jpg" works, "Image.JPG" doesn't.

  • I don't know why, it's just the way it works :)

    Because the same angle can be expressed by different numbers, when dealing with angles you should try using specific conditions and expressions. For example, instead of lerp() use anglelerp(), instead of "Is between values" use "Is between angles" etc.

  • You didn't attach any image.

    If you need to connect two sprites "physically", use Pin behavior. Pin one sprite to another and they will move together and rotate together.

    If you meant "logical" connection, you should try adding them to the same container.