dop2000's Forum Posts

  • No, I'm pretty sure that description is just a comment and you can't access it with events.

  • You are using "On Nth touch end". N here is not touch ID, it's the index! For example, if 3 fingers are touching the screen and you lift one finger, "On 2nd touch end" will be triggered.

    In your case you need "On any touch end" and then compare touch ID.

    Or simply use "On tap AreaSprite -> Buster Find path to (touch.x, touch.y)". That's it, just one one event, no need to deal with all those variables!

  • It's hard to find the exact formula, because your numbers are pretty much random, this is the closest I could make:

    spawn_rate = (200+speed)/speed

    You can add clamp((200+speed)/speed, 0.5, 15) to set minimum and maximum spawn rates.

  • I think "Array contains value" scans the entire array, you should not use it inside the loop. Try this:

    For each XY element
     Array Value at (Array.curX, Array.curY)=KeySlots.UIDofDoor 
     ---> Array delete index Array.curX
    

    You can also do this with normal "For" loop:

    For "x" from 0 to array.width-1
     Array Value at (loopindex, 1)=KeySlots.UIDofDoor 
     ---> Array delete index loopindex
    
  • I suggest doing this with MoveTo addon. Bullet is more suited for "shoot and forget" tasks. When you need to move object from one point to another predictably, with acceleration/deceleration, MoveTo is a much better choice.

  • tarek2

    Yeah, sorry, I realized my mistake and updated my post, but you had already commented on it :)

    .

    Yes, the "Else" will not run if at least one picked instance has Class & "_AtKR" animation. So the event should probably look like this:

    Pick AdventurerSprite with animation NOT EQUAL to Class&"_AtKR" 
    -> AdventurerSprite set animation Class&"_AtKR"
    
  • tarek2, I believe the "Else" event will be executed is there are no instances of AdventurerSprite (picked by parent events) with animation Class & "_AtKR".

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.